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

[config] Fix snmpagentaddress doesn't support the uppercase letters for ipv6 address #1989

Merged
merged 3 commits into from
Feb 16, 2022

Conversation

xwjiang-ms
Copy link
Contributor

@xwjiang-ms xwjiang-ms commented Dec 28, 2021

      Fixes #4852 (https://github.com/Azure/sonic-mgmt/issues/4852)

What I did

      Snmpagentaddress now support upper letters input for ipv6 address
      Fix some grammer mistakes

How I did it

      Compare the lowercase of input and netifaces addresses
      delete ; after break, convert addfress to address

How to verify it

      'sudo config snmpagentadress add FC00:1::32 -v mgmt'
      The ipv6 address can be obtained by command 'sudo ifconfig'

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

      'IP addfress is not available'

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

      we can see the entry by echoing 'show snmpagentaddress'

Ubuntu and others added 2 commits December 28, 2021 02:58
…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'
@xwjiang-ms xwjiang-ms closed this Dec 28, 2021
@xwjiang-ms xwjiang-ms reopened this Dec 28, 2021
@xwjiang-ms xwjiang-ms changed the title [config] Fix snmpagentaddress doesn't support the uppercase letters for ipv6 address (#4852) [config] Fix snmpagentaddress doesn't support the uppercase letters for ipv6 address Dec 28, 2021
@xwjiang-ms xwjiang-ms closed this Dec 28, 2021
@xwjiang-ms xwjiang-ms reopened this Dec 28, 2021
-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'
@qiluo-msft
Copy link
Contributor

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']:
Copy link
Contributor

@qiluo-msft qiluo-msft Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipaddr['addr']

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

Copy link
Contributor Author

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.

@qiluo-msft
Copy link
Contributor

@sumanbrcm Could you also help review?

@xwjiang-ms
Copy link
Contributor Author

Do you intend to fix Azure/sonic-mgmt#4852? It is not clear from your PR description.

Yes I want to fix this issue, and I have edited the description.

@xwjiang-ms xwjiang-ms merged commit 9e50124 into sonic-net:master Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants