Skip to content

Commit

Permalink
Fix for missing link-ip's
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmon2 authored Jan 31, 2018
1 parent 2aa67c9 commit b2ce352
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pathman_ini.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Updated:
- 20161204, Niklas, Added MyBGP to get SIDs from bgp-rib
- 20180131, Niklas, Fixed crash for missing link-ip
"""
Expand Down Expand Up @@ -76,7 +77,7 @@ def __init__(self, method='http', controller_ip=odl_ip, controller_port=odl_port

self.dicts['nodes']['index'] = [node['attributes'].get('node-attributes', {}).get('ipv4-router-id', '0.0.0.0') for node in self.dicts['nodes']['list']]
self.dicts['prefixes']['index'] = [prefix['prefix-descriptors']['ip-reachability-information'] for prefix in self.dicts['prefixes']['list']]
self.dicts['links']['index'] = [link['link-descriptors']['ipv4-interface-address'] for link in self.dicts['links']['list']]
self.dicts['links']['index'] = [link['link-descriptors'].get('ipv4-interface-address', '0.0.0.0') for link in self.dicts['links']['list']]

else:
logging.info('Nothing retrieved')
Expand Down

0 comments on commit b2ce352

Please sign in to comment.