Skip to content

Commit 077cf45

Browse files
arista-nwolfeAharonMalkin
authored andcommitted
Exclude disabled/missing features on non-modulars as well (sonic-net#19353)
In critical_services_tracking_list it previously only removed disabled features from the critical services list on modulars. We can have disabled features on non-modulars as well. Also handle the case where the feature is missing from config_db Signed-off-by: Aharon Malkin <[email protected]>
1 parent 823f39f commit 077cf45

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

tests/common/devices/multi_asic.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,20 @@ def critical_services_tracking_list(self):
9696
if "dhcp_server" in config_facts["FEATURE"] and config_facts["FEATURE"]["dhcp_server"]["state"] == "enabled":
9797
service_list.append("dhcp_server")
9898

99-
if self.get_facts().get("modular_chassis"):
100-
# Update the asic service based on feature table state and asic flag
101-
for service in list(self.sonichost.DEFAULT_ASIC_SERVICES):
102-
if service == 'teamd' and config_facts['DEVICE_METADATA']['localhost'].get('switch_type', '') == 'dpu':
103-
logger.info("Removing teamd from default services for switch_type DPU")
104-
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
105-
continue
106-
if config_facts['FEATURE'][service]['has_per_asic_scope'] == "False":
107-
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
108-
if config_facts['FEATURE'][service]['state'] == "disabled":
109-
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
110-
else:
99+
# Update the asic service based on feature table state and asic flag
100+
for service in list(self.sonichost.DEFAULT_ASIC_SERVICES):
101+
if service == 'teamd' and config_facts['DEVICE_METADATA']['localhost'].get('switch_type', '') == 'dpu':
102+
logger.info("Removing teamd from default services for switch_type DPU")
103+
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
104+
continue
105+
if service not in config_facts['FEATURE']:
106+
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
107+
continue
108+
if config_facts['FEATURE'][service]['has_per_asic_scope'] == "False":
109+
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
110+
if config_facts['FEATURE'][service]['state'] == "disabled":
111+
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
112+
if not self.get_facts().get("modular_chassis"):
111113
service_list.append("lldp")
112114

113115
for asic in active_asics:

0 commit comments

Comments
 (0)