Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Implements #108 #118

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions napalm_iosxr/iosxr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,8 @@ def get_interfaces_ip(self):
interfaces_ip[interface_name][u'ipv4'] = {}
if primary_ip not in interfaces_ip[interface_name].get(u'ipv4', {}).keys():
interfaces_ip[interface_name][u'ipv4'][primary_ip] = {
u'prefix_length': primary_prefix
u'prefix_length': primary_prefix,
u'primary_ip': True
}
for secondary_address in interface.xpath('VRFTable/VRF/Detail/SecondaryAddress/Entry'):
secondary_ip = napalm_base.helpers.ip(
Expand All @@ -1167,7 +1168,8 @@ def get_interfaces_ip(self):
int, napalm_base.helpers.find_txt(secondary_address, 'PrefixLength'))
if secondary_ip not in interfaces_ip[interface_name]:
interfaces_ip[interface_name][u'ipv4'][secondary_ip] = {
u'prefix_length': secondary_prefix
u'prefix_length': secondary_prefix,
u'primary_ip': False
}

# parsing IPv6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@
"BVI10": {
"ipv4": {
"192.168.0.1": {
"prefix_length": 21
"prefix_length": 21,
"primary_ip": True
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this is valid JSON. Should be true instead of True.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, True will b0rk.

}
}
},
"BVI100": {
"ipv4": {
"192.168.21.1": {
"prefix_length": 24
"prefix_length": 24,
"primary_ip": True
},
"192.168.23.1": {
"prefix_length": 24
"prefix_length": 24,
"primary_ip": False
},
"172.17.18.1": {
"prefix_length": 24
"prefix_length": 24,
"primary_ip": False
}
},
"ipv6": {
Expand Down