From ebc2716be707789ed4a783be6bbfd0bc1b90fd9b Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sun, 26 Feb 2017 23:14:56 -0500 Subject: [PATCH] removes old module.connected property from result (#21977) --- lib/ansible/modules/network/nxos/nxos_bgp.py | 1 - .../modules/network/nxos/nxos_bgp_af.py | 1 - .../modules/network/nxos/nxos_bgp_neighbor.py | 1 - .../network/nxos/nxos_bgp_neighbor_af.py | 1 - .../modules/network/nxos/nxos_evpn_vni.py | 1 - lib/ansible/modules/network/nxos/nxos_gir.py | 1 - .../nxos/nxos_gir_profile_management.py | 1 - .../network/nxos/nxos_interface_ospf.py | 1 - lib/ansible/modules/network/nxos/nxos_ospf.py | 1 - .../modules/network/nxos/nxos_ospf_vrf.py | 1 - lib/ansible/modules/network/nxos/nxos_pim.py | 1 - .../network/nxos/nxos_pim_rp_address.py | 1 - .../modules/network/nxos/nxos_snapshot.py | 49 +++++++------------ .../modules/network/nxos/nxos_vrf_af.py | 1 - .../modules/network/nxos/nxos_vxlan_vtep.py | 1 - .../network/nxos/nxos_vxlan_vtep_vni.py | 1 - 16 files changed, 19 insertions(+), 45 deletions(-) diff --git a/lib/ansible/modules/network/nxos/nxos_bgp.py b/lib/ansible/modules/network/nxos/nxos_bgp.py index 62362ef8c1..9d6a879d40 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 e804140084..72c09db301 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 7446559dab..124f18116c 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 8639e20bda..28b45000f2 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 a62f28fd3c..4e51e9a949 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 5d091a70e5..cfcfa8c3e6 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 fa5328f9ce..ab92dbad4e 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 61f22b5363..17d5ea12b1 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 a0a98ae942..f7399aac08 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 c0edc9a42d..0f59535242 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 d3f13913d3..60aa6ccb8b 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 3a6287bb00..c3b7089b24 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 fb9a9c64d6..9ad07991c2 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 91072ec6ab..8d10a859aa 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 eac3530471..45bc8ae3be 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 3e79eae8e8..57f4cae00f 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