From b2ce3526f1d0a686ad4828e8aa2d6f7cc676efd7 Mon Sep 17 00:00:00 2001 From: nikmon2 Date: Wed, 31 Jan 2018 10:33:46 -0800 Subject: [PATCH] Fix for missing link-ip's --- pathman_ini.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pathman_ini.py b/pathman_ini.py index 0a83b05..496e1c7 100644 --- a/pathman_ini.py +++ b/pathman_ini.py @@ -19,6 +19,7 @@ Updated: - 20161204, Niklas, Added MyBGP to get SIDs from bgp-rib + - 20180131, Niklas, Fixed crash for missing link-ip """ @@ -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')