Skip to content

Commit 5d74356

Browse files
authored
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.
1 parent 12b3628 commit 5d74356

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

sonic-ledd/scripts/ledd

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ SELECT_TIMEOUT = 1000
3737

3838
LEDUTIL_LOAD_ERROR = 1
3939

40-
# The empty namespace refers to linux host namespace.
41-
EMPTY_NAMESPACE = ''
42-
4340
class DaemonLedd(daemon_base.DaemonBase):
4441

4542
# Run daemon
@@ -70,8 +67,9 @@ class DaemonLedd(daemon_base.DaemonBase):
7067
self.log_error("Failed to load ledutil: %s" % (str(e)), True)
7168
sys.exit(LEDUTIL_LOAD_ERROR)
7269

73-
# Load the namespace details first from the database_global.json file.
74-
swsscommon.SonicDBConfig.initializeGlobalConfig()
70+
if multi_asic.is_multi_asic():
71+
# Load the namespace details first from the database_global.json file.
72+
swsscommon.SonicDBConfig.initializeGlobalConfig()
7573

7674
# Get the namespaces in the platform. For multi-asic devices we get the namespaces
7775
# of front-end ascis which have front-panel interfaces.

sonic-xcvrd/xcvrd/xcvrd.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@
9898
# by DaemonXcvrd
9999
helper_logger = logger.Logger(SYSLOG_IDENTIFIER)
100100

101-
# The empty namespace refers to linux host namespace.
102-
EMPTY_NAMESPACE = ''
103-
104101
#
105102
# Helper functions =============================================================
106103
#

sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,9 @@ class YCableTableUpdateTask(object):
393393
def __init__(self):
394394
self.task_thread = None
395395

396-
# Load the namespace details first from the database_global.json file.
397-
swsscommon.SonicDBConfig.initializeGlobalConfig()
396+
if multi_asic.is_multi_asic():
397+
# Load the namespace details first from the database_global.json file.
398+
swsscommon.SonicDBConfig.initializeGlobalConfig()
398399

399400
def task_worker(self):
400401

0 commit comments

Comments
 (0)