[config] Fix indentation level in _get_disabled_services_list()#965
Merged
jleveque merged 1 commit intosonic-net:masterfrom Jun 27, 2020
jleveque:fix_config_bug
Merged
[config] Fix indentation level in _get_disabled_services_list()#965jleveque merged 1 commit intosonic-net:masterfrom jleveque:fix_config_bug
jleveque merged 1 commit intosonic-net:masterfrom
jleveque:fix_config_bug
Conversation
Contributor
|
@daall FYI: this bug could not be caught by any linter I know. Maybe by vscode-python |
Contributor
|
Please add either a unit test or vs test. |
Contributor
Author
|
Retest this please |
Contributor
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! |
Contributor
Author
|
Retest this please |
abdosi
pushed a commit
that referenced
this pull request
Jul 8, 2020
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
```
abdosi
pushed a commit
to abdosi/sonic-utilities
that referenced
this pull request
Aug 4, 2020
…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 ```
stepanblyschak
pushed a commit
to stepanblyschak/sonic-utilities
that referenced
this pull request
Apr 28, 2022
[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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If FEATURE table did not exist,
config load/reload/reload_minigraphcommands would crash similar to the following: