Fix nxos_l3_interface no switchport issue with loopback and svi interfaces, nxos_snapshot issue (#41318)

* Fix nxos_l3_interface no switchport issue with loopback and svi interfaces

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Fix nxos_snapshot compare (#41386)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 1998707eda)

* changelog nxos_snapshot

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
pull/41356/merge
Trishna Guha 7 years ago committed by Matt Davis
parent da67d279be
commit 8fe99ae001

@ -0,0 +1,2 @@
bugfixes:
- Fix nxos_l3_interface no switchport issue with loopback and svi interfaces (https://github.com/ansible/ansible/pull/37392).

@ -0,0 +1,2 @@
bugfixes:
- Fix nxos_snapshot compare_option (https://github.com/ansible/ansible/pull/41386).

@ -122,7 +122,6 @@ def map_obj_to_commands(updates, module):
if command: if command:
command.append('exit') command.append('exit')
command.insert(0, 'interface {0}'.format(name)) command.insert(0, 'interface {0}'.format(name))
command.insert(1, 'no switchport')
commands.extend(command) commands.extend(command)
elif state == 'present' and obj_in_have: elif state == 'present' and obj_in_have:
@ -135,10 +134,8 @@ def map_obj_to_commands(updates, module):
if command: if command:
command.append('exit') command.append('exit')
command.insert(0, 'interface {0}'.format(name)) command.insert(0, 'interface {0}'.format(name))
command.insert(1, 'no switchport')
elif not ipv4 and not ipv6: elif not ipv4 and not ipv6:
command.append('interface {0}'.format(name)) command.append('interface {0}'.format(name))
command.append('no switchport')
commands.extend(command) commands.extend(command)
return commands return commands

@ -386,7 +386,9 @@ def main():
snapshot1 = module.params['snapshot1'] snapshot1 = module.params['snapshot1']
snapshot2 = module.params['snapshot2'] snapshot2 = module.params['snapshot2']
compare_option = module.params['compare_option'] compare_option = module.params['compare_option']
command = 'show snapshot compare {0} {1} {2}'.format(snapshot1, snapshot2, compare_option) command = 'show snapshot compare {0} {1}'.format(snapshot1, snapshot2)
if compare_option:
command += ' {0}'.format(compare_option)
content = execute_show_command(command, module)[0] content = execute_show_command(command, module)[0]
if content: if content:
write_on_file(content, comparison_results_file, module) write_on_file(content, comparison_results_file, module)

Loading…
Cancel
Save