diff --git a/lib/ansible/modules/network/nxos/nxos_bgp.py b/lib/ansible/modules/network/nxos/nxos_bgp.py index 62362ef8c14..9d6a879d40b 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp.py @@ -856,7 +856,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_bgp_af.py b/lib/ansible/modules/network/nxos/nxos_bgp_af.py index e8041400847..72c09db3015 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp_af.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp_af.py @@ -954,7 +954,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py index 7446559dabb..124f18116c1 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py @@ -613,7 +613,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py index 8639e20bda9..28b45000f24 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py @@ -966,7 +966,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_evpn_vni.py b/lib/ansible/modules/network/nxos/nxos_evpn_vni.py index a62f28fd3c5..4e51e9a949a 100644 --- a/lib/ansible/modules/network/nxos/nxos_evpn_vni.py +++ b/lib/ansible/modules/network/nxos/nxos_evpn_vni.py @@ -336,7 +336,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_gir.py b/lib/ansible/modules/network/nxos/nxos_gir.py index 5d091a70e58..cfcfa8c3e68 100644 --- a/lib/ansible/modules/network/nxos/nxos_gir.py +++ b/lib/ansible/modules/network/nxos/nxos_gir.py @@ -305,7 +305,6 @@ def main(): changed = True result = {} - result['connected'] = module.connected result['changed'] = changed if module._verbosity > 0: final_system_mode = get_system_mode(module) diff --git a/lib/ansible/modules/network/nxos/nxos_gir_profile_management.py b/lib/ansible/modules/network/nxos/nxos_gir_profile_management.py index fa5328f9ce7..ab92dbad4e1 100644 --- a/lib/ansible/modules/network/nxos/nxos_gir_profile_management.py +++ b/lib/ansible/modules/network/nxos/nxos_gir_profile_management.py @@ -207,7 +207,6 @@ def main(): changed = True end_state = invoke('get_existing', module) - result['connected'] = module.connected result['changed'] = changed if module._verbosity > 0: end_state = invoke('get_existing', module) diff --git a/lib/ansible/modules/network/nxos/nxos_interface_ospf.py b/lib/ansible/modules/network/nxos/nxos_interface_ospf.py index 61f22b53637..17d5ea12b1c 100644 --- a/lib/ansible/modules/network/nxos/nxos_interface_ospf.py +++ b/lib/ansible/modules/network/nxos/nxos_interface_ospf.py @@ -527,7 +527,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_ospf.py b/lib/ansible/modules/network/nxos/nxos_ospf.py index a0a98ae942b..f7399aac08d 100644 --- a/lib/ansible/modules/network/nxos/nxos_ospf.py +++ b/lib/ansible/modules/network/nxos/nxos_ospf.py @@ -196,7 +196,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py b/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py index c0edc9a42d4..0f595352425 100644 --- a/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py +++ b/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py @@ -442,7 +442,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_pim.py b/lib/ansible/modules/network/nxos/nxos_pim.py index d3f13913d3c..60aa6ccb8b8 100644 --- a/lib/ansible/modules/network/nxos/nxos_pim.py +++ b/lib/ansible/modules/network/nxos/nxos_pim.py @@ -179,7 +179,6 @@ def main(): exc = get_exception() module.fail_json(msg=str(exc)) - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py b/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py index 3a6287bb007..c3b7089b24e 100644 --- a/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py +++ b/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py @@ -259,7 +259,6 @@ def main(): exc = get_exception() module.fail_json(msg=str(exc)) - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_snapshot.py b/lib/ansible/modules/network/nxos/nxos_snapshot.py index fb9a9c64d68..9ad07991c24 100644 --- a/lib/ansible/modules/network/nxos/nxos_snapshot.py +++ b/lib/ansible/modules/network/nxos/nxos_snapshot.py @@ -207,15 +207,12 @@ changed: type: boolean sample: true ''' - -from ansible.module_utils.nxos import get_config, load_config, run_commands -from ansible.module_utils.nxos import nxos_argument_spec, check_args -from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.netcfg import CustomNetworkConfig - import os import re -import re + +from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.nxos import load_config, run_commands +from ansible.module_utils.nxos import nxos_argument_spec, check_args def execute_show_command(command, module, command_type='cli_show_ascii'): @@ -379,37 +376,30 @@ def write_on_file(content, filename, module): def main(): argument_spec = dict( - action=dict(required=True, choices=['create', 'add', - 'compare', 'delete', - 'delete_all']), - snapshot_name=dict(required=False, type='str'), - description=dict(required=False, type='str'), - snapshot1=dict(required=False, type='str'), - snapshot2=dict(required=False, type='str'), - compare_option=dict(required=False, - choices=['summary', 'ipv4routes', 'ipv6routes']), - comparison_results_file=dict(required=False, type='str'), - section=dict(required=False, type='str'), - show_command=dict(required=False, type='str'), - row_id=dict(required=False, type='str'), - element_key1=dict(required=False, type='str'), - element_key2=dict(required=False, type='str'), - save_snapshot_locally=dict(required=False, type='bool', - default=False), - path=dict(required=False, type='str', default='./') + action=dict(required=True, choices=['create', 'add', 'compare', 'delete', 'delete_all']), + snapshot_name=dict(type='str'), + description=dict(type='str'), + snapshot1=dict(type='str'), + snapshot2=dict(type='str'), + compare_option=dict(choices=['summary', 'ipv4routes', 'ipv6routes']), + comparison_results_file=dict(type='str'), + section=dict(type='str'), + show_command=dict(type='str'), + row_id=dict(type='str'), + element_key1=dict(type='str'), + element_key2=dict(type='str'), + save_snapshot_locally=dict(type='bool', default=False), + path=dict(type='str', default='./') ) argument_spec.update(nxos_argument_spec) module = AnsibleModule(argument_spec=argument_spec, - mutually_exclusive=[['delete_all', - 'delete_snapshot']], - supports_check_mode=True) + supports_check_mode=True) warnings = list() check_args(module, warnings) - action = module.params['action'] comparison_results_file = module.params['comparison_results_file'] @@ -469,7 +459,6 @@ def main(): written_file = write_on_file(snapshot, module.params['snapshot_name'], module) - result['connected'] = module.connected result['changed'] = changed if module._verbosity > 0: end_state = invoke('get_existing', module) diff --git a/lib/ansible/modules/network/nxos/nxos_vrf_af.py b/lib/ansible/modules/network/nxos/nxos_vrf_af.py index 91072ec6abe..8d10a859aac 100644 --- a/lib/ansible/modules/network/nxos/nxos_vrf_af.py +++ b/lib/ansible/modules/network/nxos/nxos_vrf_af.py @@ -278,7 +278,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py index eac35304719..45bc8ae3be5 100644 --- a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py +++ b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py @@ -371,7 +371,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state = invoke('get_existing', module, args) result['end_state'] = end_state diff --git a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py index 3e79eae8e8e..57f4cae00fb 100644 --- a/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py +++ b/lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py @@ -430,7 +430,6 @@ def main(): else: result['updates'] = [] - result['connected'] = module.connected if module._verbosity > 0: end_state, interface_exist = invoke('get_existing', module, args) result['end_state'] = end_state