From e4ee8528025fb08e7e330ae66dd77d9f723dbcc5 Mon Sep 17 00:00:00 2001 From: judyjoseph <53951155+judyjoseph@users.noreply.github.com> Date: Thu, 3 Sep 2020 13:59:16 -0700 Subject: [PATCH] [ledd][multi-ASIC] Update to ledd based on sonic-swss-common updates (#87) * Updated based on sonic-swss-common changes to get the namespace (PR#378) --- sonic-ledd/scripts/ledd | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sonic-ledd/scripts/ledd b/sonic-ledd/scripts/ledd index 52812dbaac29..237712da091c 100644 --- a/sonic-ledd/scripts/ledd +++ b/sonic-ledd/scripts/ledd @@ -91,7 +91,7 @@ class DaemonLedd(daemon_base.DaemonBase): while True: # Use timeout to prevent ignoring the signals we want to handle # in signal_handler() (e.g. SIGTERM for graceful shutdown) - (state, c) = sel.select(SELECT_TIMEOUT) + (state, selectableObj) = sel.select(SELECT_TIMEOUT) if state == swsscommon.Select.TIMEOUT: # Do not flood log when select times out @@ -100,9 +100,12 @@ class DaemonLedd(daemon_base.DaemonBase): self.log_warning("sel.select() did not return swsscommon.Select.OBJECT") continue - # Get the namespace from the selectable object and use it to index the SubscriberStateTable handle. - ns=c.getDbNamespace() - (key, op, fvp) = sst[ns].pop() + # Get the redisselect object from selectable object + redisSelectObj = swsscommon.CastSelectableToRedisSelectObj(selectableObj) + # Get the corresponding namespace from redisselect db connector object + namespace = redisSelectObj.getDbConnector().getNamespace() + + (key, op, fvp) = sst[namespace].pop() if fvp: # TODO: Once these flag entries have been removed from the DB, # we can remove this check