mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix state present nxos_evpn_vni (#25212)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
ea8c9a9b73
commit
fb87680046
2 changed files with 8 additions and 5 deletions
|
@ -220,9 +220,8 @@ def state_present(module, existing, proposed):
|
||||||
command = '{0} {1}'.format(key, value)
|
command = '{0} {1}'.format(key, value)
|
||||||
commands.append(command)
|
commands.append(command)
|
||||||
|
|
||||||
else:
|
if commands:
|
||||||
commands = ['vni {0} l2'.format(module.params['vni'])]
|
parents = ['evpn', 'vni {0} l2'.format(module.params['vni'])]
|
||||||
parents = ['evpn']
|
|
||||||
|
|
||||||
return commands, parents
|
return commands, parents
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,13 @@ class TestNxosEvpnVniModule(TestNxosModule):
|
||||||
self.load_config.return_value = None
|
self.load_config.return_value = None
|
||||||
|
|
||||||
def test_nxos_evpn_vni_present(self):
|
def test_nxos_evpn_vni_present(self):
|
||||||
set_module_args(dict(vni='6000', state='present'))
|
set_module_args(dict(vni='6000',
|
||||||
|
route_target_import='5000:10',
|
||||||
|
state='present'))
|
||||||
result = self.execute_module(changed=True)
|
result = self.execute_module(changed=True)
|
||||||
self.assertEqual(result['commands'], ['evpn', 'vni 6000 l2'])
|
self.assertEqual(result['commands'], ['evpn',
|
||||||
|
'vni 6000 l2',
|
||||||
|
'route-target import 5000:10'])
|
||||||
|
|
||||||
def test_nxos_evpn_vni_absent_not_existing(self):
|
def test_nxos_evpn_vni_absent_not_existing(self):
|
||||||
set_module_args(dict(vni='12000', state='absent'))
|
set_module_args(dict(vni='12000', state='absent'))
|
||||||
|
|
Loading…
Reference in a new issue