Skip to content

Commit 214b222

Browse files
netifaces provides ipadress along with zoneid
Signed-off-by: Suvarna Meenakshi <[email protected]>
1 parent 709b9d6 commit 214b222

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

config/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3253,7 +3253,7 @@ def add_snmp_agent_address(ctx, agentip, port, vrf):
32533253
ipaddresses = netifaces.ifaddresses(intf)
32543254
if ip_family[ip.version] in ipaddresses:
32553255
for ipaddr in ipaddresses[ip_family[ip.version]]:
3256-
if agent_ip_addr.lower() == ipaddr['addr'].lower():
3256+
if agentip.lower() == ipaddr['addr'].lower():
32573257
found = 1
32583258
break
32593259
if found == 1:

tests/config_snmp_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ def test_config_snmp_community_add_new_community_with_invalid_type_yang_validati
881881
@patch('netifaces.ifaddresses', mock.Mock(return_value={2:
882882
[{'addr': '10.1.0.32', 'netmask': '255.255.255.0',
883883
'broadcast': '10.1.0.255'}],
884-
10: [{'addr': 'fe80::1', 'netmask': 'ffff:ffff:ffff:ffff::/64'}]}))
884+
10: [{'addr': 'fe80::1%eth0', 'netmask': 'ffff:ffff:ffff:ffff::/64'}]}))
885885
@patch('os.system', mock.Mock(return_value=0))
886886
def test_config_snmpagentaddress_add_linklocal(self):
887887
db = Db()

0 commit comments

Comments
 (0)