Skip to content
Permalink
Browse files

Update main.py

Caught error on loading flow config when a routing instance does
not exist.
  • Loading branch information...
knewell committed Feb 6, 2020
1 parent 332a377 commit 917b9536a6be88c38f1aa5b8a9438c17354b8f5d
Showing with 5 additions and 3 deletions.
  1. +5 −3 main.py
@@ -465,14 +465,16 @@ def loadFlowRouteConfig(self):
else:
try:
instances = dev.rpc.get_config(options={'format': 'json'}, filter_xml='routing-instances')
for instance in instances['configuration']['routing-instances']['instance']:
if instance['name'] == vrf:
_vrf_data = instance['routing-options']
except TypeError as error:
logger.warn('Routing instance {} not defined. Caught "{}"'.format(vrf, error))
except IndexError as error:
logger.warn(error)
except (ConnectRefusedError, ConnectTimeoutError) as cre:
logger.warning('NETCONF connection error: {}'.format(cre))
return False
for instance in instances['configuration']['routing-instances']['instance']:
if instance['name'] == vrf:
_vrf_data = instance['routing-options']

for table in ['inet', 'inet6']:
if table == 'inet6':

0 comments on commit 917b953

Please sign in to comment.
You can’t perform that action at this time.