Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
afourmy committed Nov 8, 2017
1 parent 808fea5 commit 842fccf
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -2162,18 +2162,18 @@ def get_network_instances(self, name=''):
interface_dict[interface] = {}

instances['default'] = {
'name': 'default',
'type': 'DEFAULT_INSTANCE',
'state': {'route_distinguisher': ''},
'interfaces': {'interface': interface_dict}
}
'name': 'default',
'type': 'DEFAULT_INSTANCE',
'state': {'route_distinguisher': ''},
'interfaces': {'interface': interface_dict}
}

for vrf in sh_vrf_detail.split('\n\n'):

first_part = vrf.split('Address family')[0]

# retrieve the name of the VRF and the Route Distinguisher
name, RD = re.match(r'^VRF (\S+).*RD (.*);', first_part).groups()
vrf_name, RD = re.match(r'^VRF (\S+).*RD (.*);', first_part).groups()
if RD == '<not set>':
RD = ''

Expand All @@ -2184,12 +2184,12 @@ def get_network_instances(self, name=''):
else:
interfaces = {itf: {} for itf in if_regex.group(1).split()}

instances[name] = {
'name': name,
'type': 'L3VRF',
'state': {'route_distinguisher': RD},
'interfaces': {'interface': interfaces}
}
instances[vrf_name] = {
'name': vrf_name,
'type': 'L3VRF',
'state': {'route_distinguisher': RD},
'interfaces': {'interface': interfaces}
}
return instances if not name else instances[name]

def get_config(self, retrieve='all'):
Expand Down

0 comments on commit 842fccf

Please sign in to comment.