Fixing issue when multiple vni exist (#19928)

pull/19992/head
Gabriele 8 years ago committed by Peter Sprygada
parent f2baa6d61a
commit c980b52d33

@ -376,11 +376,11 @@ def get_existing(module, args):
parents = ['interface {0}'.format(interface_exist)] parents = ['interface {0}'.format(interface_exist)]
temp_config = netcfg.get_section(parents) temp_config = netcfg.get_section(parents)
if 'associate-vrf' in temp_config: if 'member vni {0} associate-vrf'.format(module.params['vni']) in temp_config:
parents.append('member vni {0} associate-vrf'.format( parents.append('member vni {0} associate-vrf'.format(
module.params['vni'])) module.params['vni']))
config = netcfg.get_section(parents) config = netcfg.get_section(parents)
elif 'member vni' in temp_config: elif "member vni {0}".format(module.params['vni']) in temp_config:
parents.append('member vni {0}'.format(module.params['vni'])) parents.append('member vni {0}'.format(module.params['vni']))
config = netcfg.get_section(parents) config = netcfg.get_section(parents)
else: else:

Loading…
Cancel
Save