diff options
author | Trishna Guha <trishnaguha17@gmail.com> | 2018-06-11 21:51:49 +0530 |
---|---|---|
committer | Matt Davis <nitzmahone@users.noreply.github.com> | 2018-06-11 09:21:49 -0700 |
commit | 8fe99ae001a3d3a7812f1c92ce4dd6090a52e1e6 (patch) | |
tree | 7c9d82a77d9435be74332ed2c94827045ebd5e14 | |
parent | da67d279be462b8f122c6c575563a8652947093f (diff) | |
download | ansible-8fe99ae001a3d3a7812f1c92ce4dd6090a52e1e6.tar.gz |
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 1998707eda3ac0e4a941c098473ffde78b78b6c4)
* changelog nxos_snapshot
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
4 files changed, 7 insertions, 4 deletions
diff --git a/changelogs/fragments/nxos_l3_interface_no_switchport_fix_2.5.5.yaml b/changelogs/fragments/nxos_l3_interface_no_switchport_fix_2.5.5.yaml new file mode 100644 index 0000000000..01e044922d --- /dev/null +++ b/changelogs/fragments/nxos_l3_interface_no_switchport_fix_2.5.5.yaml @@ -0,0 +1,2 @@ +bugfixes: +- Fix nxos_l3_interface no switchport issue with loopback and svi interfaces (https://github.com/ansible/ansible/pull/37392). diff --git a/changelogs/fragments/nxos_snapshot_fix_2.5.5.yaml b/changelogs/fragments/nxos_snapshot_fix_2.5.5.yaml new file mode 100644 index 0000000000..6a8a540b4c --- /dev/null +++ b/changelogs/fragments/nxos_snapshot_fix_2.5.5.yaml @@ -0,0 +1,2 @@ +bugfixes: +- Fix nxos_snapshot compare_option (https://github.com/ansible/ansible/pull/41386). diff --git a/lib/ansible/modules/network/nxos/nxos_l3_interface.py b/lib/ansible/modules/network/nxos/nxos_l3_interface.py index 4dd57c7f9f..c34bb92683 100644 --- a/lib/ansible/modules/network/nxos/nxos_l3_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_l3_interface.py @@ -122,7 +122,6 @@ def map_obj_to_commands(updates, module): if command: command.append('exit') command.insert(0, 'interface {0}'.format(name)) - command.insert(1, 'no switchport') commands.extend(command) elif state == 'present' and obj_in_have: @@ -135,10 +134,8 @@ def map_obj_to_commands(updates, module): if command: command.append('exit') command.insert(0, 'interface {0}'.format(name)) - command.insert(1, 'no switchport') elif not ipv4 and not ipv6: command.append('interface {0}'.format(name)) - command.append('no switchport') commands.extend(command) return commands diff --git a/lib/ansible/modules/network/nxos/nxos_snapshot.py b/lib/ansible/modules/network/nxos/nxos_snapshot.py index f095bc4e0e..c8deca8eae 100644 --- a/lib/ansible/modules/network/nxos/nxos_snapshot.py +++ b/lib/ansible/modules/network/nxos/nxos_snapshot.py @@ -386,7 +386,9 @@ def main(): snapshot1 = module.params['snapshot1'] snapshot2 = module.params['snapshot2'] 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] if content: write_on_file(content, comparison_results_file, module) |