Replace py-swsssdk with swsscommon#5926
Conversation
|
This PR depends on another PR to merge first: |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| @@ -114,7 +114,7 @@ def get_ifindex(duthost, port): | |||
|
|
|||
| def get_port_index(duthost, port): | |||
| py_version = 'python' if '201911' in duthost.os_version else 'python3' | |||
There was a problem hiding this comment.
Fixed.
Add code to check if the sonic_py_common.port_util class exist.
| #!/usr/bin/python | ||
|
|
||
| import swsssdk | ||
| from swsscommon import swsscommon |
There was a problem hiding this comment.
The code change may break on old device, I will test with 2018 image on by devbox.
There was a problem hiding this comment.
Fixed.
Manually test on 201911 and latest master branch. this script and related UT does not run on 201811 version.
There was a problem hiding this comment.
The sonic-mgmt master branch will not be used to test 201811 and older branch images. If this is the truth, then it is good enough, and no need to improve.
There was a problem hiding this comment.
The fix is necessary because SonicDBConfig.load_sonic_global_db_config() added on 2021, so on 2019 swsscommon exist but we still need use swsssdk.
| try: | ||
| import swsssdk | ||
| except ImportError: | ||
| from swsscommon import swsscommon |
Description of PR
Replace sonic-py-swsssdk with sonic-swss-common.
Type of change
Back port request
Approach
What is the motivation for this PR?
deprecate sonic-py-swsssdk and switch to sonic-swss-common.
How did you do it?
Replace sonic-py-swsssdk with sonic-swss-common.
How did you verify/test it?
Pass all UT.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation