Skip to content

Commit a8bc54a

Browse files
committed
Use is_multi_asic()
1 parent 85a3956 commit a8bc54a

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

acl_loader/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def __init__(self):
114114
self.tables_db_info = {}
115115
self.rules_db_info = {}
116116
self.rules_info = {}
117-
num_asic = multi_asic.get_num_asics()
118-
if num_asic > 1:
117+
118+
if multi_asic.is_multi_asic():
119119
# Load global db config
120120
SonicDBConfig.load_sonic_global_db_config()
121121
else:

crm/main.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,20 @@ def cli(ctx):
211211
# Use the db object if given as input.
212212
db = None if ctx.obj is None else ctx.obj.cfgdb
213213

214-
context = {
215-
"crm": Crm(db)
216-
}
217-
218-
ctx.obj = context
219-
220214
# Note: SonicDBConfig may be already initialized in unit test, then skip
221215
if not SonicDBConfig.isInit():
222-
num_asic = multi_asic.get_num_asics()
223-
if num_asic > 1:
216+
if multi_asic.is_multi_asic():
224217
# Load the global config file database_global.json once.
225218
SonicDBConfig.load_sonic_global_db_config()
226219
else:
227220
SonicDBConfig.initialize()
228221

222+
context = {
223+
"crm": Crm(db)
224+
}
225+
226+
ctx.obj = context
227+
229228
@cli.group()
230229
@click.pass_context
231230
def config(ctx):

scripts/lldpshow

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class Lldpshow(object):
4747
# So far only find Router and Bridge two capabilities in lldpctl, so any other capacility types will be read as Other
4848
# if further capability type is supported like WLAN, can just add the tag definition here
4949
self.ctags = {'Router': 'R', 'Bridge': 'B'}
50-
num_asic = multi_asic.get_num_asics()
51-
if num_asic > 1:
50+
51+
if multi_asic.is_multi_asic():
5252
SonicDBConfig.load_sonic_global_db_config()
5353
else:
5454
SonicDBConfig.initialize()

0 commit comments

Comments
 (0)