Skip to content

Added 'import sys' in feature.py file#1232

Merged
lguohan merged 1 commit intosonic-net:masterfrom
AkhileshSamineni:feature_issue
Nov 13, 2020
Merged

Added 'import sys' in feature.py file#1232
lguohan merged 1 commit intosonic-net:masterfrom
AkhileshSamineni:feature_issue

Conversation

@AkhileshSamineni
Copy link
Contributor

@AkhileshSamineni AkhileshSamineni commented Nov 12, 2020

If FEATURE table is not present in CONFIG_DB.

When I issue - "config feature state nat enabled", seeing below errors

root@sonic:/home/admin# config feature state nat enabled
Feature 'nat' doesn't exist
Traceback (most recent call last):
File "/usr/local/bin/config", line 10, in
sys.exit(config())
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/config/feature.py", line 26, in feature_state
sys.exit(1)
NameError: global name 'sys' is not defined
root@sonic:/home/admin#

Fix: Added 'import sys' in feature.py file.

After Fix:
root@sonic:/home/admin# config feature state nat enabled
Feature 'nat' doesn't exist
root@sonic:/home/admin#

Signed-off-by: Akhilesh Samineni [email protected]

Signed-off-by: Akhilesh Samineni <[email protected]>
@lguohan lguohan merged commit 8f156df into sonic-net:master Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants