Skip to content
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

[vnet_route_check] Align DB data parse logic with format used by swss… #2268

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

volodymyrsamotiy
Copy link
Collaborator

…common API

Signed-off-by: Volodymyr Samotiy volodymyrs@nvidia.com

What I did

  • swsscommon API was changed in order to return data from DB as a tuple instead of dictionary.
  • In some places vnet_route_check still was expecting data from DB in old format - as a dictionary.
  • But now it is a tuple, so as a result vnet_route_check was failing with "KeyError" exeption.
  • These changes fixed all the places in vnet_route_check script that used invalid data format.

As a result of above issue vnet_route_check.py script was failing with the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/vnet_route_check.py", line 364, in <module>
    sys.exit(main())
  File "/usr/local/bin/vnet_route_check.py", line 335, in main
    app_db_vnet_routes = get_vnet_routes_from_app_db()
  File "/usr/local/bin/vnet_route_check.py", line 227, in get_vnet_routes_from_app_db
    intf = vnet_intfs[vnet_name][0]
KeyError: 'Vnet_2000'

How I did it

Fixed all the places in vnet_route_check script that used invalid data format: just converted data returned by swsscommon API from tuple to dictionary.

How to verify it

  • Manually on the swicth
  • Updated UT and verified it passed

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

…common API

* swsscommon API was changed in order to return data from DB as a tuple instead of dictionary.
* In some places vnet_route_check still was expecting data from DB in old format - as a dictionary.
* But now it is a tuple, so as a result vnet_route_check was failing with "KeyError" exeption.
* These changes fixed all the places in vnet_route_check script that used invalid data format.

Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
@prsunny prsunny merged commit e49b1e8 into sonic-net:master Jul 18, 2022
qiluo-msft pushed a commit that referenced this pull request Jul 20, 2022
…common API (#2268)

* swsscommon API was changed in order to return data from DB as a tuple instead of dictionary.
* In some places vnet_route_check still was expecting data from DB in old format - as a dictionary.
* But now it is a tuple, so as a result vnet_route_check was failing with "KeyError" exeption.
* These changes fixed all the places in vnet_route_check script that used invalid data format.

Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
noaOrMlnx added a commit to noaOrMlnx/sonic-buildimage that referenced this pull request Jul 20, 2022
Update sonic-utilities submodule pointer to include the following:
* [vnet_route_check] Align DB data parse logic with format used by swsscommon API ([sonic-net#2268](sonic-net/sonic-utilities#2268))
* [202012] [generate_dump] allow to extend dump with plugin scripts ([sonic-net#2269](sonic-net/sonic-utilities#2269))

Signed-off-by: noaOrMlnx <noaor@nvidia.com>
dprital added a commit to dprital/sonic-buildimage that referenced this pull request Jul 21, 2022
Update sonic-utilities submodule pointer to include the following:
* Fix test for pfcwd_sw_enable in db_migrator_test ([sonic-net#2252](sonic-net/sonic-utilities#2252))
* [DHCPv6] [202012] Update the dhcpv6_relay config/show cli ([sonic-net#2271](sonic-net/sonic-utilities#2271))
* [vnet_route_check] Align DB data parse logic with format used by swsscommon API ([sonic-net#2268](sonic-net/sonic-utilities#2268))
* [202012] [generate_dump] allow to extend dump with plugin scripts ([sonic-net#2269](sonic-net/sonic-utilities#2269))

Signed-off-by: dprital <drorp@nvidia.com>
yxieca pushed a commit that referenced this pull request Jul 28, 2022
…common API (#2268)

* swsscommon API was changed in order to return data from DB as a tuple instead of dictionary.
* In some places vnet_route_check still was expecting data from DB in old format - as a dictionary.
* But now it is a tuple, so as a result vnet_route_check was failing with "KeyError" exeption.
* These changes fixed all the places in vnet_route_check script that used invalid data format.

Signed-off-by: Volodymyr Samotiy <volodymyrs@nvidia.com>
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 29, 2022
Update sonic-utilities submodule pointer to include the following:
* Fix test for pfcwd_sw_enable in db_migrator_test ([#2252](sonic-net/sonic-utilities#2252))
* [DHCPv6] [202012] Update the dhcpv6_relay config/show cli ([#2271](sonic-net/sonic-utilities#2271))
* [vnet_route_check] Align DB data parse logic with format used by swsscommon API ([#2268](sonic-net/sonic-utilities#2268))
* [202012] [generate_dump] allow to extend dump with plugin scripts ([#2269](sonic-net/sonic-utilities#2269))

Signed-off-by: dprital <drorp@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants