Skip to content

Commit

Permalink
[Supervisor][fabric] Modify the deinit function not to remove CHASSIS…
Browse files Browse the repository at this point in the history
…_FABRIC_ASIC_TABLE when supervisorctl stop chassisd (#340)

Code changes are implemented in deinit function such that it does not remove entries in CHASSI_FABRIC_ASIC_TABLE when supervisorctl stop chassisd is triggered.
  • Loading branch information
prem-nokia authored Mar 16, 2023
1 parent 03374b2 commit e815bdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions sonic-chassisd/scripts/chassisd
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ class ModuleUpdater(logger.Logger):
self.chassis_table._del(CHASSIS_INFO_KEY_TEMPLATE.format(1))

if self.asic_table is not None:
asics = list(self.asic_table.getKeys())
for asic in asics:
self.asic_table._del(asic)
if not self._is_supervisor():
asics = list(self.asic_table.getKeys())
for asic in asics:
self.asic_table._del(asic)

def modules_num_update(self):
# Check if module list is populated
Expand Down
6 changes: 2 additions & 4 deletions sonic-chassisd/tests/test_chassisd.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,8 @@ def verify_fabric_asic(asic_name, asic_pci_address, module_name, asic_id_in_modu
midplane_table = module_updater.midplane_table
fvs = midplane_table.get(name)
assert fvs == None
fvs = fabric_asic_table.get("asic4")
assert fvs == None
fvs = fabric_asic_table.get("asic5")
assert fvs == None
verify_fabric_asic("asic4", "0000:04:00.0", name, "0")
verify_fabric_asic("asic5", "0000:05:00.0", name, "1")

def test_signal_handler():
exit_code = 0
Expand Down

0 comments on commit e815bdf

Please sign in to comment.