Skip to content

Commit 1c9ea92

Browse files
committed
[tempershow] Fix multi-ASIC: initialize global DB config for namespace resolution
On multi-ASIC platforms, SonicDBConfig.load_sonic_global_db_config() must be called before creating namespace-scoped SonicV2Connector instances. Without this, connect_to_all_dbs_for_ns() fails with 'validateNamespace: Initialize global DB config' and SFP temperatures from per-ASIC namespace STATE_DBs are not displayed. Add the standard isGlobalInit/load_sonic_global_db_config guard in TemperShow.__init__(), matching the pattern used by fdbshow, fdbclear, and nbrshow. Signed-off-by: Vasundhara Volam <vvolam@microsoft.com>
1 parent 6baf219 commit 1c9ea92

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/tempershow

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import json
88
from datetime import datetime
99

1010
from tabulate import tabulate
11-
from swsscommon.swsscommon import SonicV2Connector
11+
from swsscommon.swsscommon import SonicDBConfig, SonicV2Connector
1212
from natsort import natsorted
1313

1414
try:
@@ -67,6 +67,8 @@ NA = 'N/A'
6767

6868
class TemperShow(object):
6969
def __init__(self):
70+
if not SonicDBConfig.isGlobalInit():
71+
SonicDBConfig.load_sonic_global_db_config()
7072
self.db = SonicV2Connector(host="127.0.0.1")
7173
self.db.connect(self.db.STATE_DB)
7274
self._sfp_helper_ready = self._init_sfp_util_helper()

0 commit comments

Comments
 (0)