Skip to content

Commit ea5987c

Browse files
committed
Fix test vs runtime check
Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
1 parent 83d1938 commit ea5987c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

config/main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8203,9 +8203,9 @@ def enable(enable):
82038203
@click.pass_context
82048204
def ntp(ctx):
82058205
"""NTP server configuration tasks"""
8206-
# This is checking to see if there is a db attribute present in ctx.obj,
8207-
# to differentiate it between unit test scenario and runtime scenario.
8208-
if 'db' not in dir(ctx.obj):
8206+
# This is checking to see if ctx.obj is a dictionary, to differentiate it
8207+
# between unit test scenario and runtime scenario.
8208+
if isinstance(ctx.obj, dict):
82098209
config_db = ConfigDBConnector()
82108210
config_db.connect()
82118211
ctx.obj = {'db': config_db}

0 commit comments

Comments
 (0)