-
Notifications
You must be signed in to change notification settings - Fork 116
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
[snmp] Allow system with no ports in config db run without errors #221
Conversation
Signed-off-by: liora <liora@nvidia.com>
Signed-off-by: liora <liora@nvidia.com>
Signed-off-by: liora <liora@nvidia.com>
Signed-off-by: liora <liora@nvidia.com>
This pull request introduces 1 alert when merging 49188ec into 21d7d97 - view on LGTM.com new alerts:
|
It is failing since in this commit we call function get_interface_oid_map in its new form. |
Signed-off-by: liora <liora@nvidia.com>
Important |
@qiluo-msft checkers are failing from the same reason I stated above. It is failing since in this commit we call function get_interface_oid_map in its new form. |
@@ -30,3 +35,16 @@ def test_init_sync_d_lag_tables(self): | |||
|
|||
self.assertTrue("PortChannel_Temp" in lag_name_if_name_map) | |||
self.assertTrue(lag_name_if_name_map["PortChannel_Temp"] == []) | |||
|
|||
@mock.patch('swsssdk.dbconnector.SonicV2Connector.get_all', mock.MagicMock(return_value=({}))) |
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.
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.
Did you run python3 -m pytest -s -v -k test_init_sync_d_interface_tables
?
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.
swsssdk is the right one (method get_all is part of class SonicV2Connector which is implemented in sonic-buildimage/sonic-py-swsssdk/src/swsssdk/dbconnector.py).
Yes, I ran python3 -m pytest -s -v -k test_init_sync_d_interface_tables.
Could you solve the conflicts? |
@qiluo-msft |
#109) **What I did** Allow system with no ports in config db to run without errors/warnings. This is needed for modular system which should boot and run properly without line cards. **How I did it** Check if table exists before calling get_all for it and return empty list if there are no ports in COUNTERS_PORT_NAME_MAP table in counters db. **How to verify it** Run snmpwalk on the root oid. **Important** This PR must be merged before PR sonic-net/sonic-snmpagent#221 is merged.
@qiluo-msft I resolved the conflict, thanks for the heads up. |
@qiluo-msft
PR sonic-net/sonic-py-swsssdk#109 contains the required change in get_interface_oid_map() and it is merged, however tests ran with the old version of the function, do you know why? |
You need to move submodule in sonic-buildimage repo. |
@qiluo-msft |
/azp run |
Commenter does not have sufficient privileges for PR 221 in repo Azure/sonic-snmpagent |
@liat-grozovik |
Please update the hash of sonic-py-swsssdk submodule in sonic-buildimage. |
@qiluo-msft sonic-buildimage is updated with the latest sonic-py-swsssdk hash (see sonic-net/sonic-buildimage#8757) can you please rerun the checkers? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
PR owner could retrigger checkers by "/azpw run" |
What I did
Allow system with no ports in config db run without errors.
This is needed for modular system which should boot properly without line cards.
How I did it
Remove snmpagent error exit if there are no ports in config DB or in counters DB.
How to verify it
Run snmpwalk on the root oid.
Important
This PR must be merged only after PR sonic-net/sonic-py-swsssdk#109 is merged.