mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
make eos_vlan idempotent (#34443)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
ab67539bef
commit
0f24199012
1 changed files with 8 additions and 5 deletions
|
@ -140,7 +140,8 @@ def map_obj_to_commands(updates, module):
|
|||
elif state == 'present':
|
||||
if not obj_in_have:
|
||||
commands.append('vlan %s' % w['vlan_id'])
|
||||
commands.append('name %s' % w['name'])
|
||||
if w['name']:
|
||||
commands.append('name %s' % w['name'])
|
||||
|
||||
if w['interfaces']:
|
||||
for i in w['interfaces']:
|
||||
|
@ -172,13 +173,15 @@ def map_obj_to_commands(updates, module):
|
|||
else:
|
||||
if not obj_in_have:
|
||||
commands.append('vlan %s' % w['vlan_id'])
|
||||
commands.append('name %s' % w['name'])
|
||||
if w['name']:
|
||||
commands.append('name %s' % w['name'])
|
||||
commands.append('state %s' % w['state'])
|
||||
elif obj_in_have['name'] != w['name'] or obj_in_have['state'] != w['state']:
|
||||
elif (w['name'] and obj_in_have['name'] != w['name']) or obj_in_have['state'] != w['state']:
|
||||
commands.append('vlan %s' % w['vlan_id'])
|
||||
|
||||
if obj_in_have['name'] != w['name']:
|
||||
commands.append('name %s' % w['name'])
|
||||
if w['name']:
|
||||
if obj_in_have['name'] != w['name']:
|
||||
commands.append('name %s' % w['name'])
|
||||
|
||||
if obj_in_have['state'] != w['state']:
|
||||
commands.append('state %s' % w['state'])
|
||||
|
|
Loading…
Reference in a new issue