@@ -20,35 +20,9 @@ import docker
20
20
import sys
21
21
22
22
import swsssdk
23
- from sonic_py_common import multi_asic , device_info , daemon_base
23
+ from sonic_py_common import multi_asic , device_info
24
24
from swsscommon import swsscommon
25
25
26
- def get_asic_presence_list ():
27
- """
28
- @summary: This function will get the asic presence list. On Supervisor, the list includes only the asics
29
- for inserted and detected fabric cards. For non-supervisor cards, e.g. line card, the list should
30
- contain all supported asics by the card. The function gets the asic list from CHASSIS_ASIC_TABLE from
31
- CHASSIS_STATE_DB. The function assumes that the first N asic ids (asic0 to asic(N-1)) in
32
- CHASSIS_ASIC_TABLE belongs to the supervisor, where N is the max number of asics supported by the Chassis
33
- @return: List of asics present
34
- """
35
- asics_list = []
36
- if multi_asic .is_multi_asic ():
37
- if not device_info .is_supervisor ():
38
- # Supervisor has FRU Fabric cards. If not supervisor, all asics
39
- # should be present. Add all asics, 0 - num_asics to the list.
40
- asics_list = list (range (0 ,multi_asic .get_num_asics ()))
41
- else :
42
- # Get asic list from CHASSIS_ASIC_TABLE
43
- chassis_state_db = daemon_base .db_connect ("CHASSIS_STATE_DB" )
44
- asic_table = swsscommon .Table (chassis_state_db , 'CHASSIS_ASIC_TABLE' )
45
- if asic_table :
46
- asics_presence_list = list (asic_table .getKeys ())
47
- for asic in asics_presence_list :
48
- # asic is asid id: asic0, asic1.... asicN. Get the numeric value.
49
- asics_list .append (int (asic [4 :]))
50
- return asics_list
51
-
52
26
def get_expected_running_containers ():
53
27
"""
54
28
@summary: This function will get the expected running & always-enabled containers by following the rule:
@@ -69,10 +43,14 @@ def get_expected_running_containers():
69
43
70
44
# Get current asic presence list. For multi_asic system, multi instance containers
71
45
# should be checked only for asics present.
72
- asics_id_presence = get_asic_presence_list ()
46
+ asics_id_presence = multi_asic . get_asic_presence_list ()
73
47
74
- # Some services, like database and bgp run all the instances irrespective of asic presence.
48
+ # Some services may run all the instances irrespective of asic presence.
75
49
# Add those to exception list.
50
+ # database service: Currently services have dependency on all database services to
51
+ # be up irrespective of asic presence.
52
+ # bgp service: Currently bgp runs all instances. Once this is fixed to be config driven,
53
+ # it will be removed from exception list.
76
54
run_all_instance_list = ['database' , 'bgp' ]
77
55
78
56
for container_name in feature_table .keys ():
0 commit comments