Skip to content

Commit

Permalink
Remove lldp as default service for Chassis (sonic-net#13115)
Browse files Browse the repository at this point in the history
Why I did:
To fix this sonic-net/sonic-buildimage#19174
On Modular chassis for LC lldp in global scope is not needed.

How I verify:
Manual changes

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
  • Loading branch information
abdosi authored and mssonicbld committed Jun 12, 2024
1 parent 41ad996 commit b9f82fb
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions tests/common/devices/multi_asic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MultiAsicSonicHost(object):
So, even a single asic pizza box is represented as a MultiAsicSonicHost with 1 SonicAsic.
"""

_DEFAULT_SERVICES = ["pmon", "snmp", "lldp", "database"]
_DEFAULT_SERVICES = ["pmon", "snmp", "database"]

def __init__(self, ansible_adhoc, hostname, duthosts, topo_type):
""" Initializing a MultiAsicSonicHost.
Expand Down Expand Up @@ -64,13 +64,16 @@ def critical_services_tracking_list(self):
"""
service_list = []
active_asics = self.asics
if self.sonichost.is_supervisor_node() and self.get_facts()['asic_type'] != 'vs':
active_asics = []
sonic_db_cli_out = self.command("sonic-db-cli CHASSIS_STATE_DB keys \"CHASSIS_FABRIC_ASIC_TABLE|asic*\"")
for a_asic_line in sonic_db_cli_out["stdout_lines"]:
a_asic_name = a_asic_line.split("|")[1]
a_asic_instance = self.asic_instance_from_namespace(namespace=a_asic_name)
active_asics.append(a_asic_instance)
if self.sonichost.is_supervisor_node():
self._DEFAULT_SERVICES.append("lldp")
if self.get_facts()['asic_type'] != 'vs':
active_asics = []
sonic_db_cli_out = \
self.command("sonic-db-cli CHASSIS_STATE_DB keys \"CHASSIS_FABRIC_ASIC_TABLE|asic*\"")
for a_asic_line in sonic_db_cli_out["stdout_lines"]:
a_asic_name = a_asic_line.split("|")[1]
a_asic_instance = self.asic_instance_from_namespace(namespace=a_asic_name)
active_asics.append(a_asic_instance)
service_list += self._DEFAULT_SERVICES

config_facts = self.config_facts(host=self.hostname, source="running")['ansible_facts']
Expand All @@ -94,6 +97,9 @@ def critical_services_tracking_list(self):
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
if config_facts['FEATURE'][service]['state'] == "disabled":
self.sonichost.DEFAULT_ASIC_SERVICES.remove(service)
else:
self._DEFAULT_SERVICES.append("lldp")

for asic in active_asics:
service_list += asic.get_critical_services()
self.sonichost.reset_critical_services_tracking_list(service_list)
Expand Down

0 comments on commit b9f82fb

Please sign in to comment.