From 5d743568a210571eb1061ad45117d22d425bd202 Mon Sep 17 00:00:00 2001 From: judyjoseph <53951155+judyjoseph@users.noreply.github.com> Date: Wed, 2 Dec 2020 17:24:44 -0800 Subject: [PATCH] Clean some unused variables, check for multiAsic before calling initializeGlobalConfig (#130) The check for multiAsic before calling initializeGlobalConfig was done in xcvrd earlier. Adding now to the other processes in sonic-platform-daemons as well. --- sonic-ledd/scripts/ledd | 8 +++----- sonic-xcvrd/xcvrd/xcvrd.py | 3 --- sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py | 5 +++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sonic-ledd/scripts/ledd b/sonic-ledd/scripts/ledd index 237712da0..342f73d85 100644 --- a/sonic-ledd/scripts/ledd +++ b/sonic-ledd/scripts/ledd @@ -37,9 +37,6 @@ SELECT_TIMEOUT = 1000 LEDUTIL_LOAD_ERROR = 1 -# The empty namespace refers to linux host namespace. -EMPTY_NAMESPACE = '' - class DaemonLedd(daemon_base.DaemonBase): # Run daemon @@ -70,8 +67,9 @@ class DaemonLedd(daemon_base.DaemonBase): self.log_error("Failed to load ledutil: %s" % (str(e)), True) sys.exit(LEDUTIL_LOAD_ERROR) - # Load the namespace details first from the database_global.json file. - swsscommon.SonicDBConfig.initializeGlobalConfig() + if multi_asic.is_multi_asic(): + # Load the namespace details first from the database_global.json file. + swsscommon.SonicDBConfig.initializeGlobalConfig() # Get the namespaces in the platform. For multi-asic devices we get the namespaces # of front-end ascis which have front-panel interfaces. diff --git a/sonic-xcvrd/xcvrd/xcvrd.py b/sonic-xcvrd/xcvrd/xcvrd.py index 21b07e974..c803fca1a 100644 --- a/sonic-xcvrd/xcvrd/xcvrd.py +++ b/sonic-xcvrd/xcvrd/xcvrd.py @@ -98,9 +98,6 @@ # by DaemonXcvrd helper_logger = logger.Logger(SYSLOG_IDENTIFIER) -# The empty namespace refers to linux host namespace. -EMPTY_NAMESPACE = '' - # # Helper functions ============================================================= # diff --git a/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py b/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py index 0abf7d434..7f753708e 100644 --- a/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py +++ b/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py @@ -393,8 +393,9 @@ class YCableTableUpdateTask(object): def __init__(self): self.task_thread = None - # Load the namespace details first from the database_global.json file. - swsscommon.SonicDBConfig.initializeGlobalConfig() + if multi_asic.is_multi_asic(): + # Load the namespace details first from the database_global.json file. + swsscommon.SonicDBConfig.initializeGlobalConfig() def task_worker(self):