Fix to nxos_vrf purge breaks with empty aggregate (#66004)
* resolving conflicts * fixed issue with purge and state var. fixed space issue with vrf name * lint issues
This commit is contained in:
parent
f70f426604
commit
a3d67edfca
1 changed files with 12 additions and 8 deletions
|
@ -237,11 +237,13 @@ def map_obj_to_commands(updates, module):
|
|||
admin_state = w['admin_state']
|
||||
vni = w['vni']
|
||||
interfaces = w.get('interfaces') or []
|
||||
if purge:
|
||||
state = "absent"
|
||||
else:
|
||||
state = w['state']
|
||||
del w['state']
|
||||
|
||||
obj_in_have = search_obj_in_list(name, have)
|
||||
|
||||
if state == 'absent' and obj_in_have:
|
||||
commands.append('no vrf context {0}'.format(name))
|
||||
|
||||
|
@ -344,6 +346,8 @@ def map_obj_to_commands(updates, module):
|
|||
|
||||
|
||||
def validate_vrf(name, module):
|
||||
if name:
|
||||
name = name.strip()
|
||||
if name == 'default':
|
||||
module.fail_json(msg='cannot use default as name of a VRF')
|
||||
elif len(name) > 32:
|
||||
|
|
Loading…
Reference in a new issue