-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[config] Fix indentation level in _get_disabled_services_list() #965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works!
@daall FYI: this bug could not be caught by any linter I know. Maybe by vscode-python |
Please add either a unit test or vs test. |
Retest this please |
Interesting! I guess since it is technically OK to do something like this in python:
The linters don't check for it. Your suggestion of adding a test case for it is a good one! |
Retest this please |
If FEATURE table did not exist,` config load/reload/reload_minigraph` commands would crash similar to the following: ``` Executing reset-failed of service nat... Executing reset-failed of service sflow... Traceback (most recent call last): File "/usr/bin/config", line 12, in <module> sys.exit(config()) File "/usr/lib/python2.7/dist-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python2.7/dist-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python2.7/dist-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/config/main.py", line 862, in reload _restart_services() File "/usr/lib/python2.7/dist-packages/config/main.py", line 585, in _restart_services disable_services = _get_disabled_services_list() File "/usr/lib/python2.7/dist-packages/config/main.py", line 518, in _get_disabled_services_list if status == "disabled": UnboundLocalError: local variable 'status' referenced before assignment ```
…c-net#965) If FEATURE table did not exist,` config load/reload/reload_minigraph` commands would crash similar to the following: ``` Executing reset-failed of service nat... Executing reset-failed of service sflow... Traceback (most recent call last): File "/usr/bin/config", line 12, in <module> sys.exit(config()) File "/usr/lib/python2.7/dist-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python2.7/dist-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python2.7/dist-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/config/main.py", line 862, in reload _restart_services() File "/usr/lib/python2.7/dist-packages/config/main.py", line 585, in _restart_services disable_services = _get_disabled_services_list() File "/usr/lib/python2.7/dist-packages/config/main.py", line 518, in _get_disabled_services_list if status == "disabled": UnboundLocalError: local variable 'status' referenced before assignment ```
[sfpshow][mock_state_db] Tweak key names of some transceiver info fields (sonic-net#958) [config] Fix syntax error (sonic-net#966) [config] Fix indentation level in _get_disabled_services_list() (sonic-net#965)
If FEATURE table did not exist,
config load/reload/reload_minigraph
commands would crash similar to the following: