Skip to content

Commit

Permalink
Some additional module cleanup of mistakes made during merging
Browse files Browse the repository at this point in the history
  • Loading branch information
jimi-c authored and mattclay committed Dec 8, 2016
1 parent 6ba6819 commit fa5386c
Show file tree
Hide file tree
Showing 36 changed files with 183 additions and 183 deletions.
Empty file.
6 changes: 3 additions & 3 deletions lib/ansible/modules/cloud/misc/virt_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def __init__(self, uri, module):

self.module = module

conn = libvirt.open(uri)
conn = libvirt.open(uri)

if not conn:
raise Exception("hypervisor connection failure")
Expand Down Expand Up @@ -439,10 +439,10 @@ def get_pool(self, entryid):
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

Expand Down
4 changes: 2 additions & 2 deletions lib/ansible/modules/cloud/openstack/os_ironic.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
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.
Expand All @@ -91,7 +91,7 @@
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"'
Expand Down
10 changes: 5 additions & 5 deletions lib/ansible/modules/network/nxos/nxos_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def to_list(val):
return list(val)
elif val is not None:
return [val]
else:
else:
return list()


Expand Down Expand Up @@ -355,7 +355,7 @@ def add(self, lines, parents=None):


def get_network_module(**kwargs):
try:
try:
return get_module(**kwargs)
except NameError:
return NetworkModule(**kwargs)
Expand Down Expand Up @@ -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'])

Expand Down Expand Up @@ -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']
Expand Down
10 changes: 5 additions & 5 deletions lib/ansible/modules/network/nxos/nxos_acl_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def to_list(val):
return list(val)
elif val is not None:
return [val]
else:
else:
return list()


Expand Down Expand Up @@ -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)
Expand All @@ -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'])

Expand Down Expand Up @@ -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']
Expand Down
12 changes: 6 additions & 6 deletions lib/ansible/modules/network/nxos/nxos_bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def to_list(val):
return list(val)
elif val is not None:
return [val]
else:
else:
return list()


Expand Down Expand Up @@ -468,7 +468,7 @@ def add(self, lines, parents=None):


def get_network_module(**kwargs):
try:
try:
return get_module(**kwargs)
except NameError:
return NetworkModule(**kwargs)
Expand Down Expand Up @@ -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'])

Expand Down Expand Up @@ -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 = [
Expand Down
12 changes: 6 additions & 6 deletions lib/ansible/modules/network/nxos/nxos_bgp_af.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def to_list(val):
return list(val)
elif val is not None:
return [val]
else:
else:
return list()


Expand Down Expand Up @@ -408,7 +408,7 @@ def add(self, lines, parents=None):


def get_network_module(**kwargs):
try:
try:
return get_module(**kwargs)
except NameError:
return NetworkModule(**kwargs)
Expand Down Expand Up @@ -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'])

Expand Down Expand Up @@ -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']:
Expand Down
12 changes: 6 additions & 6 deletions lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
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
Expand Down Expand Up @@ -260,7 +260,7 @@ def to_list(val):
return list(val)
elif val is not None:
return [val]
else:
else:
return list()


Expand Down Expand Up @@ -352,7 +352,7 @@ def add(self, lines, parents=None):


def get_network_module(**kwargs):
try:
try:
return get_module(**kwargs)
except NameError:
return NetworkModule(**kwargs)
Expand Down Expand Up @@ -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'])

Expand Down Expand Up @@ -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':
Expand Down
12 changes: 6 additions & 6 deletions lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def to_list(val):
return list(val)
elif val is not None:
return [val]
else:
else:
return list()


Expand Down Expand Up @@ -429,7 +429,7 @@ def add(self, lines, parents=None):


def get_network_module(**kwargs):
try:
try:
return get_module(**kwargs)
except NameError:
return NetworkModule(**kwargs)
Expand Down Expand Up @@ -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'])

Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions lib/ansible/modules/network/nxos/nxos_evpn_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def to_list(val):
return list(val)
elif val is not None:
return [val]
else:
else:
return list()


Expand Down Expand Up @@ -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)
Expand All @@ -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'])

Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/ansible/modules/network/nxos/nxos_evpn_vni.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def to_list(val):
return list(val)
elif val is not None:
return [val]
else:
else:
return list()


Expand Down Expand Up @@ -234,7 +234,7 @@ def add(self, lines, parents=None):


def get_network_module(**kwargs):
try:
try:
return get_module(**kwargs)
except NameError:
return NetworkModule(**kwargs)
Expand Down Expand Up @@ -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'])

Expand Down
Loading

0 comments on commit fa5386c

Please sign in to comment.