Skip to content

Commit 83d1938

Browse files
committed
Fix sudo config ntp add no longer working
Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
1 parent 46fc7b6 commit 83d1938

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

config/main.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -8203,7 +8203,9 @@ def enable(enable):
82038203
@click.pass_context
82048204
def ntp(ctx):
82058205
"""NTP server configuration tasks"""
8206-
if 'db' not in ctx.obj:
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):
82078209
config_db = ConfigDBConnector()
82088210
config_db.connect()
82098211
ctx.obj = {'db': config_db}

0 commit comments

Comments
 (0)