Skip to content

Commit

Permalink
netifaces provides ipadress along with zoneid
Browse files Browse the repository at this point in the history
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
  • Loading branch information
SuvarnaMeenakshi committed Aug 2, 2024
1 parent 709b9d6 commit 214b222
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3253,7 +3253,7 @@ def add_snmp_agent_address(ctx, agentip, port, vrf):
ipaddresses = netifaces.ifaddresses(intf)
if ip_family[ip.version] in ipaddresses:
for ipaddr in ipaddresses[ip_family[ip.version]]:
if agent_ip_addr.lower() == ipaddr['addr'].lower():
if agentip.lower() == ipaddr['addr'].lower():
found = 1
break
if found == 1:
Expand Down
2 changes: 1 addition & 1 deletion tests/config_snmp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def test_config_snmp_community_add_new_community_with_invalid_type_yang_validati
@patch('netifaces.ifaddresses', mock.Mock(return_value={2:
[{'addr': '10.1.0.32', 'netmask': '255.255.255.0',
'broadcast': '10.1.0.255'}],
10: [{'addr': 'fe80::1', 'netmask': 'ffff:ffff:ffff:ffff::/64'}]}))
10: [{'addr': 'fe80::1%eth0', 'netmask': 'ffff:ffff:ffff:ffff::/64'}]}))
@patch('os.system', mock.Mock(return_value=0))
def test_config_snmpagentaddress_add_linklocal(self):
db = Db()
Expand Down

0 comments on commit 214b222

Please sign in to comment.