Convert to Python 3#1128
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
config/config_mgmt.py
Outdated
There was a problem hiding this comment.
| for it in list(D1.keys()): | |
| for it in D1: |
There was a problem hiding this comment.
This will not work. It would need to be:
for it, _ in D1:I will not make a change like this in this PR. Plus, keeping .keys() makes it clear what the intention is.
There was a problem hiding this comment.
It will work. I think you are talking about
for it, _ in D1.items():
In reply to: 499074240 [](ancestors = 499074240)
There was a problem hiding this comment.
Yes, you're correct. I misread this one. Everything started blending together after all these changes :)
I will go back through and do a cleanup pass in the future.
config/config_mgmt.py
Outdated
There was a problem hiding this comment.
| for key in list(In.keys()): | |
| for it in In: |
There was a problem hiding this comment.
This will not work. It would need to be:
for it, _ in In:I will not make a change like this in this PR. Plus, keeping .keys() makes it clear what the intention is.
config/main.py
Outdated
There was a problem hiding this comment.
| for intf in list(del_intf_dict.keys()): | |
| for intf in del_intf_dict: |
There was a problem hiding this comment.
This will not work. It would need to be:
for intf, _ in del_intf_dict:I will not make a change like this in this PR. Plus, keeping .keys() makes it clear what the intention is.
config/main.py
Outdated
There was a problem hiding this comment.
list [](start = 28, length = 4)
The same
There was a problem hiding this comment.
This will not work. It would need to be:
for feature_name, _ in feature_table:I will not make a change like this in this PR. Plus, keeping .keys() makes it clear what the intention is.
config/main.py
Outdated
There was a problem hiding this comment.
list [](start = 18, length = 4)
The same
There was a problem hiding this comment.
This will not work. It would need to be something like:
for (_,intf), _ in vlan_member_table:I will not make a change like this in this PR. Plus, keeping .keys() makes it clear what the intention is.
There was a problem hiding this comment.
However, I did add a space after the comma.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Only test and build Python 3 package of sonic-utilities. Eliminate Python 2 build and do not install Python 2 dependencies. sonic-net/sonic-utilities#1128 is silently passing all Python 3 unit tests (see output here). Once this PR is merged, then the check build will pass, allowing that PR to merge.
|
This pull request fixes 8 alerts when merging 0dba073cabd8479f92a446f095c7355795f29841 into 8079558 - view on LGTM.com fixed alerts:
|
|
This pull request fixes 8 alerts when merging 800350f into 8079558 - view on LGTM.com fixed alerts:
|
- What I did
Conform syntax to support Python 3 using 2to3 tool and manual assessment
- How I did it
Using 2to3 tool as well as manual assessment
- How to verify it
Build a Python 3 version of the sonic-utilities package, install and test all applications
NOTE: This cannot currently be done, as sonic-utilities depends on sonic-config-engine and sonic-yang-mgmt, neither of which are we currently building Python 3 versions of.Need Python 3 version of sonic-config-engineNeed Python 3 version of sonic-yang-mgmt