diff --git a/lib/ansible/modules/cloud/centurylink/__init__.py b/lib/ansible/modules/cloud/centurylink/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/ansible/modules/cloud/misc/virt_pool.py b/lib/ansible/modules/cloud/misc/virt_pool.py index f9a7ba4913..4a24dffee0 100644 --- a/lib/ansible/modules/cloud/misc/virt_pool.py +++ b/lib/ansible/modules/cloud/misc/virt_pool.py @@ -234,7 +234,7 @@ class LibvirtConnection(object): self.module = module - conn = libvirt.open(uri) + conn = libvirt.open(uri) if not conn: raise Exception("hypervisor connection failure") @@ -439,10 +439,10 @@ class VirtStoragePool(object): def list_pools(self, state=None): results = [] for entry in self.conn.find_entry(-1): - if state: + if state: if state == self.conn.get_status2(entry): results.append(entry.name()) - else: + else: results.append(entry.name()) return results diff --git a/lib/ansible/modules/cloud/openstack/os_ironic.py b/lib/ansible/modules/cloud/openstack/os_ironic.py index 2658203646..2296082f32 100644 --- a/lib/ansible/modules/cloud/openstack/os_ironic.py +++ b/lib/ansible/modules/cloud/openstack/os_ironic.py @@ -81,7 +81,7 @@ options: description: - Information necessary to turn this server on / off. This often includes such things as IPMI username, password, and IP address. - required: true + required: true deploy: description: - Information necessary to deploy this server directly, without using Nova. THIS IS NOT RECOMMENDED. @@ -91,7 +91,7 @@ options: management: description: - Information necessary to interact with this server's management interface. May be shared by power_info in some cases. - required: true + required: true nics: description: - 'A list of network interface cards, eg, " - mac: aa:bb:cc:aa:bb:cc"' diff --git a/lib/ansible/modules/network/nxos/nxos_acl.py b/lib/ansible/modules/network/nxos/nxos_acl.py index ce1a19e018..63762f9761 100644 --- a/lib/ansible/modules/network/nxos/nxos_acl.py +++ b/lib/ansible/modules/network/nxos/nxos_acl.py @@ -263,7 +263,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -355,7 +355,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -383,13 +383,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -686,7 +686,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] action = module.params['action'] diff --git a/lib/ansible/modules/network/nxos/nxos_acl_interface.py b/lib/ansible/modules/network/nxos/nxos_acl_interface.py index 739f55c044..e9dbcb3fe0 100644 --- a/lib/ansible/modules/network/nxos/nxos_acl_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_acl_interface.py @@ -121,7 +121,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -222,7 +222,7 @@ def get_config(module, include_defaults=False): config = module.params['config'] if not config: try: - config = module.get_config() + config = module.get_config() except AttributeError: defaults = module.params['include_defaults'] config = module.config.get_config(include_defaults=defaults) @@ -241,13 +241,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -476,7 +476,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] name = module.params['name'] diff --git a/lib/ansible/modules/network/nxos/nxos_bgp.py b/lib/ansible/modules/network/nxos/nxos_bgp.py index 785e112253..a6306fe74c 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp.py @@ -376,7 +376,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -468,7 +468,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -496,13 +496,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -903,9 +903,9 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - required_together=[['timer_bgp_hold', + required_together=[['timer_bgp_hold', 'timer_bgp_keepalive']], - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] args = [ diff --git a/lib/ansible/modules/network/nxos/nxos_bgp_af.py b/lib/ansible/modules/network/nxos/nxos_bgp_af.py index 0181591bd5..3b804d51a3 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp_af.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp_af.py @@ -316,7 +316,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -408,7 +408,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -436,13 +436,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -993,11 +993,11 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - required_together=[DAMPENING_PARAMS, + required_together=[DAMPENING_PARAMS, ['distance_ibgp', 'distance_ebgp', 'distance_local']], - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] if module.params['dampening_routemap']: diff --git a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py index 6d117b7c50..f0cc614581 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py @@ -90,7 +90,7 @@ options: log_neighbor_changes: description: - Specify whether or not to enable log messages for neighbor - up/down event. + up/down event. required: false choices: ['enable', 'disable', 'inherit'] default: null @@ -260,7 +260,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -352,7 +352,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -380,13 +380,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -685,7 +685,7 @@ def main(): module = get_network_module(argument_spec=argument_spec, required_together=[['timer_bgp_hold', 'timer_bgp_keepalive']], - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] if module.params['pwd_type'] == 'default': 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 36db7ec8e2..e7d9ea6481 100644 --- a/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py +++ b/lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py @@ -337,7 +337,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -429,7 +429,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -457,13 +457,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -1005,9 +1005,9 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - mutually_exclusive=[['advertise_map_exist', + mutually_exclusive=[['advertise_map_exist', 'advertise_map_non_exist']], - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] if ((module.params['max_prefix_interval'] or diff --git a/lib/ansible/modules/network/nxos/nxos_evpn_global.py b/lib/ansible/modules/network/nxos/nxos_evpn_global.py index e2389ab526..375269e070 100644 --- a/lib/ansible/modules/network/nxos/nxos_evpn_global.py +++ b/lib/ansible/modules/network/nxos/nxos_evpn_global.py @@ -88,7 +88,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -189,7 +189,7 @@ def get_config(module, include_defaults=False): config = module.params['config'] if not config: try: - config = module.get_config() + config = module.get_config() except AttributeError: defaults = module.params['include_defaults'] config = module.config.get_config(include_defaults=defaults) @@ -208,13 +208,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -287,7 +287,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) existing = invoke('get_existing', module) end_state = existing diff --git a/lib/ansible/modules/network/nxos/nxos_evpn_vni.py b/lib/ansible/modules/network/nxos/nxos_evpn_vni.py index 15d620a6d1..5d20addd63 100644 --- a/lib/ansible/modules/network/nxos/nxos_evpn_vni.py +++ b/lib/ansible/modules/network/nxos/nxos_evpn_vni.py @@ -142,7 +142,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -234,7 +234,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -262,13 +262,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) diff --git a/lib/ansible/modules/network/nxos/nxos_feature.py b/lib/ansible/modules/network/nxos/nxos_feature.py index f959035172..2a532dd599 100644 --- a/lib/ansible/modules/network/nxos/nxos_feature.py +++ b/lib/ansible/modules/network/nxos/nxos_feature.py @@ -119,7 +119,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -211,7 +211,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -239,13 +239,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -453,7 +453,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) feature = validate_feature(module) state = module.params['state'].lower() diff --git a/lib/ansible/modules/network/nxos/nxos_file_copy.py b/lib/ansible/modules/network/nxos/nxos_file_copy.py index 08601b0fb4..0885c4575e 100644 --- a/lib/ansible/modules/network/nxos/nxos_file_copy.py +++ b/lib/ansible/modules/network/nxos/nxos_file_copy.py @@ -107,7 +107,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -199,7 +199,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -227,13 +227,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -373,7 +373,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) local_file = module.params['local_file'] remote_file = module.params['remote_file'] diff --git a/lib/ansible/modules/network/nxos/nxos_hsrp.py b/lib/ansible/modules/network/nxos/nxos_hsrp.py index 36d6f6a2f3..9e9e7e3542 100644 --- a/lib/ansible/modules/network/nxos/nxos_hsrp.py +++ b/lib/ansible/modules/network/nxos/nxos_hsrp.py @@ -159,7 +159,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -251,7 +251,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -279,13 +279,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -620,7 +620,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) interface = module.params['interface'].lower() group = module.params['group'] diff --git a/lib/ansible/modules/network/nxos/nxos_igmp.py b/lib/ansible/modules/network/nxos/nxos_igmp.py index 216922f226..3cd5a0dbd2 100644 --- a/lib/ansible/modules/network/nxos/nxos_igmp.py +++ b/lib/ansible/modules/network/nxos/nxos_igmp.py @@ -128,7 +128,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -220,7 +220,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -248,13 +248,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -344,7 +344,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] restart = module.params['restart'] diff --git a/lib/ansible/modules/network/nxos/nxos_igmp_interface.py b/lib/ansible/modules/network/nxos/nxos_igmp_interface.py index 7294455a48..d5e3226d34 100644 --- a/lib/ansible/modules/network/nxos/nxos_igmp_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_igmp_interface.py @@ -254,7 +254,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -346,7 +346,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -374,13 +374,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -756,7 +756,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] interface = module.params['interface'] @@ -907,4 +907,4 @@ def main(): if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/lib/ansible/modules/network/nxos/nxos_interface_ospf.py b/lib/ansible/modules/network/nxos/nxos_interface_ospf.py index c4a2ee6be4..9f63bf57a0 100644 --- a/lib/ansible/modules/network/nxos/nxos_interface_ospf.py +++ b/lib/ansible/modules/network/nxos/nxos_interface_ospf.py @@ -182,7 +182,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -274,7 +274,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -302,13 +302,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -601,11 +601,11 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - required_together=[['message_digest_key_id', - 'message_digest_algorithm_type', - 'message_digest_encryption_type', - 'message_digest_password']], - supports_check_mode=True) + required_together=[['message_digest_key_id', + 'message_digest_algorithm_type', + 'message_digest_encryption_type', + 'message_digest_password']], + supports_check_mode=True) for param in ['message_digest_encryption_type', 'message_digest_algorithm_type', diff --git a/lib/ansible/modules/network/nxos/nxos_ip_interface.py b/lib/ansible/modules/network/nxos/nxos_ip_interface.py index 09fd478044..b860ea20b6 100644 --- a/lib/ansible/modules/network/nxos/nxos_ip_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_ip_interface.py @@ -132,7 +132,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -224,7 +224,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -252,13 +252,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -641,7 +641,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) addr = module.params['addr'] version = module.params['version'] diff --git a/lib/ansible/modules/network/nxos/nxos_ospf.py b/lib/ansible/modules/network/nxos/nxos_ospf.py index d6f47bbc35..024b5f0ba2 100644 --- a/lib/ansible/modules/network/nxos/nxos_ospf.py +++ b/lib/ansible/modules/network/nxos/nxos_ospf.py @@ -96,7 +96,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -197,7 +197,7 @@ def get_config(module, include_defaults=False): config = module.params['config'] if not config: try: - config = module.get_config() + config = module.get_config() except AttributeError: defaults = module.params['include_defaults'] config = module.config.get_config(include_defaults=defaults) @@ -216,13 +216,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) diff --git a/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py b/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py index 3d049edcad..35e0d398f0 100644 --- a/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py +++ b/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py @@ -187,7 +187,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -279,7 +279,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -307,13 +307,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) diff --git a/lib/ansible/modules/network/nxos/nxos_overlay_global.py b/lib/ansible/modules/network/nxos/nxos_overlay_global.py index dda0d48413..5b7d89c4b2 100644 --- a/lib/ansible/modules/network/nxos/nxos_overlay_global.py +++ b/lib/ansible/modules/network/nxos/nxos_overlay_global.py @@ -127,7 +127,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -219,7 +219,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -247,13 +247,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -377,7 +377,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) args = [ 'anycast_gateway_mac' diff --git a/lib/ansible/modules/network/nxos/nxos_pim.py b/lib/ansible/modules/network/nxos/nxos_pim.py index 7fc4080def..659686ceaa 100644 --- a/lib/ansible/modules/network/nxos/nxos_pim.py +++ b/lib/ansible/modules/network/nxos/nxos_pim.py @@ -91,7 +91,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -183,7 +183,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -211,13 +211,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -292,7 +292,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) splitted_ssm_range = module.params['ssm_range'].split('.') if len(splitted_ssm_range) != 4 and module.params['ssm_range'] != 'none': 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 5149d4d3fb..c53747e02d 100644 --- a/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py +++ b/lib/ansible/modules/network/nxos/nxos_pim_rp_address.py @@ -121,7 +121,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -213,7 +213,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -241,13 +241,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -358,10 +358,10 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - mutually_exclusive=[['group_list', 'route_map'], - ['group_list', 'prefix_list'], - ['route_map', 'prefix_list']], - supports_check_mode=True) + mutually_exclusive=[['group_list', 'route_map'], + ['group_list', 'prefix_list'], + ['route_map', 'prefix_list']], + supports_check_mode=True) state = module.params['state'] diff --git a/lib/ansible/modules/network/nxos/nxos_ping.py b/lib/ansible/modules/network/nxos/nxos_ping.py index 1bb7b044d7..a698b98ba8 100644 --- a/lib/ansible/modules/network/nxos/nxos_ping.py +++ b/lib/ansible/modules/network/nxos/nxos_ping.py @@ -137,7 +137,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -229,7 +229,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -257,13 +257,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -389,7 +389,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) destination = module.params['dest'] count = module.params['count'] diff --git a/lib/ansible/modules/network/nxos/nxos_reboot.py b/lib/ansible/modules/network/nxos/nxos_reboot.py index ce31a9b8f9..c479d10a80 100644 --- a/lib/ansible/modules/network/nxos/nxos_reboot.py +++ b/lib/ansible/modules/network/nxos/nxos_reboot.py @@ -79,7 +79,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -171,7 +171,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -199,13 +199,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -275,7 +275,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) confirm = module.params['confirm'] if not confirm: diff --git a/lib/ansible/modules/network/nxos/nxos_rollback.py b/lib/ansible/modules/network/nxos/nxos_rollback.py index bff47e5512..736fa25cca 100644 --- a/lib/ansible/modules/network/nxos/nxos_rollback.py +++ b/lib/ansible/modules/network/nxos/nxos_rollback.py @@ -95,7 +95,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -187,7 +187,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -215,13 +215,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -248,18 +248,18 @@ def execute_commands(cmds, module, command_type=None): module.fail_json(msg='Error sending {0}'.format(cmds), error=str(clie)) except AttributeError: - try: - if command_type: + try: + if command_type: command_type = command_type_map.get(command_type) module.cli.add_commands(cmds, output=command_type) response = module.cli.run_commands() - else: + else: module.cli.add_commands(cmds, output=command_type) response = module.cli.run_commands() - except ShellError: - clie = get_exception() - module.fail_json(msg='Error sending {0}'.format(cmds), - error=str(clie)) + except ShellError: + clie = get_exception() + module.fail_json(msg='Error sending {0}'.format(cmds), + error=str(clie)) return response @@ -278,7 +278,7 @@ def checkpoint(filename, module): def rollback(filename, module): commands = ['rollback running-config file %s' % filename] try: - module.configure(commands) + module.configure(commands) except AttributeError: try: module.cli.add_commands(commands, output='config') diff --git a/lib/ansible/modules/network/nxos/nxos_smu.py b/lib/ansible/modules/network/nxos/nxos_smu.py index d487aaf64b..1404725ac3 100644 --- a/lib/ansible/modules/network/nxos/nxos_smu.py +++ b/lib/ansible/modules/network/nxos/nxos_smu.py @@ -102,7 +102,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -194,7 +194,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -222,13 +222,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -351,7 +351,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) pkg = module.params['pkg'] file_system = module.params['file_system'] diff --git a/lib/ansible/modules/network/nxos/nxos_static_route.py b/lib/ansible/modules/network/nxos/nxos_static_route.py index 5433c0ef5e..2ff042d030 100644 --- a/lib/ansible/modules/network/nxos/nxos_static_route.py +++ b/lib/ansible/modules/network/nxos/nxos_static_route.py @@ -126,7 +126,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -220,7 +220,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -248,13 +248,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -430,7 +430,7 @@ def main(): ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] diff --git a/lib/ansible/modules/network/nxos/nxos_vlan.py b/lib/ansible/modules/network/nxos/nxos_vlan.py index b81bc98295..67719262bd 100644 --- a/lib/ansible/modules/network/nxos/nxos_vlan.py +++ b/lib/ansible/modules/network/nxos/nxos_vlan.py @@ -175,7 +175,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -267,7 +267,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -295,13 +295,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -568,9 +568,9 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - mutually_exclusive=[['vlan_range', 'name'], - ['vlan_id', 'vlan_range']], - supports_check_mode=True) + mutually_exclusive=[['vlan_range', 'name'], + ['vlan_id', 'vlan_range']], + supports_check_mode=True) vlan_range = module.params['vlan_range'] vlan_id = module.params['vlan_id'] diff --git a/lib/ansible/modules/network/nxos/nxos_vpc.py b/lib/ansible/modules/network/nxos/nxos_vpc.py index 849018cf92..42af1cb651 100644 --- a/lib/ansible/modules/network/nxos/nxos_vpc.py +++ b/lib/ansible/modules/network/nxos/nxos_vpc.py @@ -166,7 +166,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -258,7 +258,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -286,13 +286,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -578,7 +578,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) domain = module.params['domain'] role_priority = module.params['role_priority'] diff --git a/lib/ansible/modules/network/nxos/nxos_vpc_interface.py b/lib/ansible/modules/network/nxos/nxos_vpc_interface.py index de5a660cf0..6f122f6f2d 100644 --- a/lib/ansible/modules/network/nxos/nxos_vpc_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_vpc_interface.py @@ -118,7 +118,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -210,7 +210,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -238,13 +238,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -486,8 +486,8 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - mutually_exclusive=[['vpc', 'peer_link']], - supports_check_mode=True) + mutually_exclusive=[['vpc', 'peer_link']], + supports_check_mode=True) portchannel = module.params['portchannel'] vpc = module.params['vpc'] diff --git a/lib/ansible/modules/network/nxos/nxos_vrf.py b/lib/ansible/modules/network/nxos/nxos_vrf.py index 217007b54f..eb60306e08 100644 --- a/lib/ansible/modules/network/nxos/nxos_vrf.py +++ b/lib/ansible/modules/network/nxos/nxos_vrf.py @@ -135,7 +135,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -227,7 +227,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -255,13 +255,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -458,7 +458,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) vrf = module.params['vrf'] admin_state = module.params['admin_state'].lower() diff --git a/lib/ansible/modules/network/nxos/nxos_vrf_af.py b/lib/ansible/modules/network/nxos/nxos_vrf_af.py index f0b008476f..70ca67109e 100644 --- a/lib/ansible/modules/network/nxos/nxos_vrf_af.py +++ b/lib/ansible/modules/network/nxos/nxos_vrf_af.py @@ -122,7 +122,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -214,7 +214,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -242,13 +242,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -379,7 +379,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) state = module.params['state'] diff --git a/lib/ansible/modules/network/nxos/nxos_vrf_interface.py b/lib/ansible/modules/network/nxos/nxos_vrf_interface.py index ca04148496..a3420307a6 100644 --- a/lib/ansible/modules/network/nxos/nxos_vrf_interface.py +++ b/lib/ansible/modules/network/nxos/nxos_vrf_interface.py @@ -119,7 +119,7 @@ def to_list(val): return list(val) elif val is not None: return [val] - else: + else: return list() @@ -211,7 +211,7 @@ class CustomNetworkConfig(NetworkConfig): def get_network_module(**kwargs): - try: + try: return get_module(**kwargs) except NameError: return NetworkModule(**kwargs) @@ -239,13 +239,13 @@ def load_config(module, candidate): if commands: if not module.check_mode: try: - module.configure(commands) + module.configure(commands) except AttributeError: module.config(commands) if save_config: try: - module.config.save_config() + module.config.save_config() except AttributeError: module.execute(['copy running-config startup-config']) @@ -427,7 +427,7 @@ def main(): save=dict(type='bool', default=False) ) module = get_network_module(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=True) vrf = module.params['vrf'] interface = module.params['interface'].lower() @@ -505,4 +505,4 @@ def main(): if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/lib/ansible/modules/system/pam_limits.py b/lib/ansible/modules/system/pam_limits.py index 7f6598e980..f47fbf06bb 100644 --- a/lib/ansible/modules/system/pam_limits.py +++ b/lib/ansible/modules/system/pam_limits.py @@ -170,12 +170,12 @@ def main(): space_pattern = re.compile(r'\s+') message = '' - f = open (limits_conf, 'r') + f = open (limits_conf, 'r') # Tempfile nf = tempfile.NamedTemporaryFile() found = False - new_value = value + new_value = value for line in f: diff --git a/lib/ansible/modules/windows/win_user.py b/lib/ansible/modules/windows/win_user.py index 03b8f3eabb..3158208db6 100644 --- a/lib/ansible/modules/windows/win_user.py +++ b/lib/ansible/modules/windows/win_user.py @@ -57,7 +57,7 @@ options: update_password: description: - C(always) will update passwords if they differ. C(on_create) will - only set the password for newly created users. + only set the password for newly created users. required: false choices: [ 'always', 'on_create' ] default: always