Closed abdosi closed 3 years ago
class SwssSyncClient(mockredis.MockRedis):
Please check https://github.com/Azure/sonic-utilities/pull/1238/files
I think you need similar change to make it support decode_responses
option #Closed
Refers to: tests/mock_tables/dbconnector.py:37 in 4d0963a. [](commit_id = 4d0963a670cd4e5eba44e9b08d2c490bb70eb888, deletion_comment = False)
class SwssSyncClient(mockredis.MockRedis):
Please check https://github.com/Azure/sonic-utilities/pull/1238/files I think you need similar change to make it support
decode_responses
optionRefers to: tests/mock_tables/dbconnector.py:37 in 4d0963a. [](commit_id = 4d0963a, deletion_comment = False)
@qiluo-msft Updated. Modified function to do first _encode (by calling base class function) and if dcode_response == True then decode it back. Works for both python2 and python3.
Need to modify setup.py to acknowledge Python 3 support: https://github.com/Azure/sonic-dbsyncd/blob/master/setup.py#L38. LGTM tool also uses this to determine what version of Python to check code with.
Also, do we need to continue supporting Python 2 with this package? If not we should remove Python 2 from that list.
Also, please ensure the dependencies in setup.py are correct and complete. One thing that stands out to me is
'enum34>=1.1.6'
here. This package should only be installed for Python 2, if installed for Python 3, it will break theenum
module in the standard library. If we need to continue supporting Python 2, you can do something like I did here.
@jleveque Updated setup.py. Also I have updated jekin pr build of this repo to to just compile/build/install/test python3 wheel. As part of submodule-update PR for sonic-buildimage will update the Makefile and make lldp docker to start using this python3 package and other corresponding changes.
Jenkin Config Change for PR Job:
retest this please
Remove extra line? no need to change this file.
@qiluo-msft Done #Closed
Refers to: tests/mock_tables/LLDP_ENTRY_TABLE.json:474 in 67d4206. [](commit_id = 67d42068d00da93cd56a515115a35e23b2c19bbf, deletion_comment = False)
@jleveque /@qiluo-msft Any idea on this failure ? Do we need to update something on jenkins. It is working fine in local enviroment.
https://sonic-jenkins.westus2.cloudapp.azure.com/job/common/job/sonic-dbsyncd-build-pr/50/console
retest this please
retest this please
@jleveque and @qiluo-msft. Can you please review the PR. All the comments are addressed.
Jenkins job was failing when I reverted Jenkin to not to do pip-install for dependency package and rely on setup.py. That looks to be Jenkin machine issue. Eg:(https://sonic-jenkins.westus2.cloudapp.azure.com/job/common/job/sonic-dbsyncd-build-pr/50/console)
As of now Jenkin job is same as previous and move all commands from python to python3. python2 package is removed and we are building python3 package.
Rest of changes to start using python3 package will come as part of submodule update PR.
retest this please
@abdosi will you remove https://github.com/Azure/sonic-buildimage/blob/master/rules/dbsyncd-py2.mk ?
yes @qiluo-msft
What I did:
Changes to convert sonic-dbsyncd from python 2 to 3. Tool 2to3 was used for it.
As part of the conversion found issue with unit test test_sync_roundtrip() where LLDP table information for eth0 and Ethernet0 can overwrite each since we make dictionary key based on integer part of port name
How I verify:
Python3 wheel package getting build and pytest working