-
Notifications
You must be signed in to change notification settings - Fork 661
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
[config] Fix snmpagentaddress doesn't support the uppercase letters for ipv6 address #1989
Conversation
…or ipv6 address (#4852) -What I did Snmpagentaddress now support upper letters input for ipv6 address Fix some grammer mistakes -How I did Convert all agentip to lower letters to match netifaces addresses delete ; after break, convert addfress to address -How to verify it 'sudo config snmpagentaddress add FC00:1::32 -v mgmt' The ipv6 address can be obtained by command 'sudo ifconfig'
-What I did Snmpagentaddress now support upper letters input for ipv6 address -How I did Compare the lower letter of input and netifaces addresses -How to verify it 'sudo config snmpagentaddress add FC00:1::32 -v mgmt' The ipv6 address can be obtained by command 'sudo ifconfig'
Do you intend to fix sonic-net/sonic-mgmt#4852? It is not clear from your PR description. |
config/main.py
Outdated
@@ -2490,11 +2492,11 @@ def add_snmp_agent_address(ctx, agentip, port, vrf): | |||
for ipaddr in ipaddresses[ip_family[ip.version]]: | |||
if agentip == ipaddr['addr']: |
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.
Currently the ConfigDB has no way to enforce the lowercase for SNMP_AGENT_ADDRESS_CONFIG key. So there may be already lowercase entries.
Suggest you compare ipv6 address case insensitive. This library may help https://docs.python.org/3/library/ipaddress.html
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.
I see, it's better to compare the lowercase of IPv6 addresses, and I have modified my PR, thanks.
@sumanbrcm Could you also help review? |
Yes I want to fix this issue, and I have edited the description. |
What I did
How I did it
How to verify it
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)