We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83d1938 commit ea5987cCopy full SHA for ea5987c
config/main.py
@@ -8203,9 +8203,9 @@ def enable(enable):
8203
@click.pass_context
8204
def ntp(ctx):
8205
"""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):
+ # This is checking to see if ctx.obj is a dictionary, to differentiate it
+ # between unit test scenario and runtime scenario.
+ if isinstance(ctx.obj, dict):
8209
config_db = ConfigDBConnector()
8210
config_db.connect()
8211
ctx.obj = {'db': config_db}
0 commit comments