-
Notifications
You must be signed in to change notification settings - Fork 292
CP-49931: mv scripts/xe-reset-networking
to python3/bin
#5810
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
CP-49931: mv scripts/xe-reset-networking
to python3/bin
#5810
Conversation
python3/bin/xe-reset-networking
Outdated
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
""" | ||
# pyright: reportPossiblyUnboundVariable=false |
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.
Why is it not worth declaring the variable instead?
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.
Initially, it was my recommendation to not touch the warnings (disable them) because the script's style is quite old (bad):
Many locations trigger this warning:
The reason was that I did not immediately see a clean way to fix all possibly unbound variable warnings.
The cause for the many unbound variables warnings is that the exception handling wasn't done nicely.
Now, to fix all of them, I had the idea to use a context manager handling it:
- In case you like it, I've pushed the fixes for
pyright
now to the PR. Please check!
New commit:
CP-49931: mv scripts/xe-reset-networking to python3/bin, fix pyright
Fix pyright:
- Rework unclean exception handling using a contextmanager.
- Declare address and master in case of an Exception as well.
- Fix warning on unsupported escape sequence using a raw string.
Signed-off-by: Ashwinh <ashwin.h@cloud.com>
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
scripts/xe-reset-networking
to python3/bin
There are some conflicts, this needs rebasing |
Working on it |
Fix pyright: - Rework unclean exception handling using a contextmanager. - Declare address and master in case of an Exception as well. - Fix warning on unsupported escape sequence using a raw string. - Removed python2 script check from pyproject.toml Signed-off-by: Bernhard Kaindl <[email protected]> Signed-off-by: Ashwinh <[email protected]>
Main ticket CP-49100 :Move python3 scripts from scripts directory to python3 directory.
Sub task CP-49931: mv
scripts/xe-reset-networking
topython3/bin
Update summary: @psafont asked:
@bernhardkaindl added:
@psafont: please check those fixes for it:
Added fixes for
pyright
unbound variable warnings:Fixed a "scary" pylint warning too: