PEP 8 E111 cleanup for nxos modules.
This commit is contained in:
parent
4a57cba86d
commit
462ab6b1db
61 changed files with 380 additions and 427 deletions
|
@ -173,12 +173,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -168,12 +168,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -259,12 +259,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -117,12 +117,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -372,12 +372,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -312,12 +312,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -256,12 +256,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -333,12 +333,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -84,12 +84,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -138,12 +138,12 @@ from ansible.module_utils.network import NetworkModule
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -115,12 +115,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -103,12 +103,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -175,12 +175,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -131,12 +131,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -155,12 +155,12 @@ from ansible.module_utils.network import NetworkModule
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
@ -574,8 +574,8 @@ def is_default(interface, module):
|
|||
def validate_config(body, vip, module):
|
||||
new_body = ''.join(body)
|
||||
if "invalid ip address" in new_body.lower():
|
||||
module.fail_json(msg="Invalid VIP. Possible duplicate IP address.",
|
||||
vip=vip)
|
||||
module.fail_json(msg="Invalid VIP. Possible duplicate IP address.",
|
||||
vip=vip)
|
||||
|
||||
|
||||
def validate_params(param, module):
|
||||
|
|
|
@ -124,12 +124,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -250,12 +250,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -145,12 +145,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -129,12 +129,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -174,12 +174,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -178,12 +178,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -128,12 +128,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -135,12 +135,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
@ -548,8 +548,8 @@ def main():
|
|||
if sysmtu:
|
||||
if ((int(sysmtu) < 576 or int(sysmtu) > 9216 or
|
||||
((int(sysmtu) % 2) != 0))):
|
||||
module.fail_json(msg='Invalid MTU- needs to be an even '
|
||||
'number between 576 and 9216')
|
||||
module.fail_json(msg='Invalid MTU- needs to be an even '
|
||||
'number between 576 and 9216')
|
||||
|
||||
args = dict(mtu=mtu, sysmtu=sysmtu)
|
||||
proposed = dict((k, v) for k, v in args.items() if v is not None)
|
||||
|
|
|
@ -141,12 +141,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -139,12 +139,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -120,12 +120,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -92,12 +92,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -183,12 +183,12 @@ from ansible.module_utils.shell import ShellError
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
@ -394,8 +394,8 @@ def get_existing(module, args):
|
|||
vrf_index = False
|
||||
for index in range(0, len(splitted_config) - 1):
|
||||
if 'vrf' in splitted_config[index].strip():
|
||||
vrf_index = index
|
||||
break
|
||||
vrf_index = index
|
||||
break
|
||||
if vrf_index:
|
||||
config = '\n'.join(splitted_config[0:vrf_index])
|
||||
|
||||
|
|
|
@ -123,12 +123,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -87,12 +87,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -204,12 +204,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
@ -737,10 +737,10 @@ def default_pim_interface_policies(existing, jp_bidir):
|
|||
|
||||
if jp_bidir:
|
||||
if existing.get('jp_policy_in') or existing.get('jp_policy_out'):
|
||||
if existing.get('jp_type_in') == 'prefix':
|
||||
command = 'no ip pim jp-policy prefix-list {0}'.format(
|
||||
existing.get('jp_policy_in')
|
||||
)
|
||||
if existing.get('jp_type_in') == 'prefix':
|
||||
command = 'no ip pim jp-policy prefix-list {0}'.format(
|
||||
existing.get('jp_policy_in')
|
||||
)
|
||||
if command:
|
||||
commands.append(command)
|
||||
|
||||
|
|
|
@ -117,12 +117,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -133,12 +133,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -142,12 +142,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -75,12 +75,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -91,12 +91,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -98,12 +98,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -224,12 +224,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -114,12 +114,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -99,12 +99,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -147,12 +147,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -106,12 +106,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -117,12 +117,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -128,12 +128,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -122,12 +122,12 @@ from ansible.module_utils.network import NetworkModule
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -170,12 +170,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -124,12 +124,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -123,12 +123,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -171,12 +171,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -162,12 +162,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -114,12 +114,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -131,12 +131,12 @@ from ansible.module_utils.network import NetworkModule
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
@ -502,8 +502,8 @@ def main():
|
|||
command = get_commands_to_config_vrf(delta, vrf)
|
||||
commands.extend(command)
|
||||
elif delta:
|
||||
command = get_commands_to_config_vrf(delta, vrf)
|
||||
commands.extend(command)
|
||||
command = get_commands_to_config_vrf(delta, vrf)
|
||||
commands.extend(command)
|
||||
|
||||
if commands:
|
||||
if proposed.get('vni'):
|
||||
|
|
|
@ -118,12 +118,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
@ -301,8 +301,8 @@ def get_existing(module, args):
|
|||
vrf_index = False
|
||||
for index in range(0, len(splitted_config) - 1):
|
||||
if 'vrf' in splitted_config[index].strip():
|
||||
vrf_index = index
|
||||
break
|
||||
vrf_index = index
|
||||
break
|
||||
if vrf_index:
|
||||
config = '\n'.join(splitted_config[0:vrf_index])
|
||||
|
||||
|
|
|
@ -115,12 +115,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -153,12 +153,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -100,12 +100,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -117,12 +117,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
@ -440,8 +440,8 @@ def main():
|
|||
"state=present.")
|
||||
else:
|
||||
if not existing.get('domain'):
|
||||
module.fail_json(msg='Cannot remove a vtp password '
|
||||
'before vtp domain is set.')
|
||||
module.fail_json(msg='Cannot remove a vtp password '
|
||||
'before vtp domain is set.')
|
||||
|
||||
elif existing['vtp_password'] != ('\\'):
|
||||
commands.append(['no vtp password'])
|
||||
|
|
|
@ -95,12 +95,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -138,12 +138,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
|
|
@ -157,12 +157,12 @@ except ImportError:
|
|||
|
||||
|
||||
def to_list(val):
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
if isinstance(val, (list, tuple)):
|
||||
return list(val)
|
||||
elif val is not None:
|
||||
return [val]
|
||||
else:
|
||||
return list()
|
||||
|
||||
|
||||
class CustomNetworkConfig(NetworkConfig):
|
||||
|
@ -555,10 +555,10 @@ def main():
|
|||
'the switch.')
|
||||
elif (existing and state == 'absent' and
|
||||
existing['vni'] != module.params['vni']):
|
||||
module.fail_json(msg="ERROR: VNI delete failed: Could not find"
|
||||
" vni node for {0}".format(
|
||||
module.params['vni']),
|
||||
existing_vni=existing['vni'])
|
||||
module.fail_json(msg="ERROR: VNI delete failed: Could not find"
|
||||
" vni node for {0}".format(
|
||||
module.params['vni']),
|
||||
existing_vni=existing['vni'])
|
||||
else:
|
||||
candidate = CustomNetworkConfig(indent=3)
|
||||
invoke('state_%s' % state, module, existing, proposed, candidate)
|
||||
|
|
|
@ -173,66 +173,19 @@ lib/ansible/modules/network/f5/bigip_pool_member.py
|
|||
lib/ansible/modules/network/f5/bigip_virtual_server.py
|
||||
lib/ansible/modules/network/haproxy.py
|
||||
lib/ansible/modules/network/nmcli.py
|
||||
lib/ansible/modules/network/nxos/nxos_aaa_server.py
|
||||
lib/ansible/modules/network/nxos/nxos_aaa_server_host.py
|
||||
lib/ansible/modules/network/nxos/nxos_acl.py
|
||||
lib/ansible/modules/network/nxos/nxos_acl_interface.py
|
||||
lib/ansible/modules/network/nxos/nxos_bgp.py
|
||||
lib/ansible/modules/network/nxos/nxos_bgp_af.py
|
||||
lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py
|
||||
lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py
|
||||
lib/ansible/modules/network/nxos/nxos_evpn_global.py
|
||||
lib/ansible/modules/network/nxos/nxos_evpn_vni.py
|
||||
lib/ansible/modules/network/nxos/nxos_feature.py
|
||||
lib/ansible/modules/network/nxos/nxos_file_copy.py
|
||||
lib/ansible/modules/network/nxos/nxos_gir.py
|
||||
lib/ansible/modules/network/nxos/nxos_gir_profile_management.py
|
||||
lib/ansible/modules/network/nxos/nxos_hsrp.py
|
||||
lib/ansible/modules/network/nxos/nxos_igmp.py
|
||||
lib/ansible/modules/network/nxos/nxos_igmp_interface.py
|
||||
lib/ansible/modules/network/nxos/nxos_igmp_snooping.py
|
||||
lib/ansible/modules/network/nxos/nxos_install_os.py
|
||||
lib/ansible/modules/network/nxos/nxos_interface.py
|
||||
lib/ansible/modules/network/nxos/nxos_interface_ospf.py
|
||||
lib/ansible/modules/network/nxos/nxos_ip_interface.py
|
||||
lib/ansible/modules/network/nxos/nxos_mtu.py
|
||||
lib/ansible/modules/network/nxos/nxos_ntp.py
|
||||
lib/ansible/modules/network/nxos/nxos_ntp_auth.py
|
||||
lib/ansible/modules/network/nxos/nxos_ntp_options.py
|
||||
lib/ansible/modules/network/nxos/nxos_ospf.py
|
||||
lib/ansible/modules/network/nxos/nxos_ospf_vrf.py
|
||||
lib/ansible/modules/network/nxos/nxos_overlay_global.py
|
||||
lib/ansible/modules/network/nxos/nxos_pim.py
|
||||
lib/ansible/modules/network/nxos/nxos_pim_interface.py
|
||||
lib/ansible/modules/network/nxos/nxos_pim_rp_address.py
|
||||
lib/ansible/modules/network/nxos/nxos_ping.py
|
||||
lib/ansible/modules/network/nxos/nxos_portchannel.py
|
||||
lib/ansible/modules/network/nxos/nxos_reboot.py
|
||||
lib/ansible/modules/network/nxos/nxos_rollback.py
|
||||
lib/ansible/modules/network/nxos/nxos_smu.py
|
||||
lib/ansible/modules/network/nxos/nxos_snapshot.py
|
||||
lib/ansible/modules/network/nxos/nxos_snmp_community.py
|
||||
lib/ansible/modules/network/nxos/nxos_snmp_contact.py
|
||||
lib/ansible/modules/network/nxos/nxos_snmp_host.py
|
||||
lib/ansible/modules/network/nxos/nxos_snmp_location.py
|
||||
lib/ansible/modules/network/nxos/nxos_snmp_traps.py
|
||||
lib/ansible/modules/network/nxos/nxos_snmp_user.py
|
||||
lib/ansible/modules/network/nxos/nxos_static_route.py
|
||||
lib/ansible/modules/network/nxos/nxos_switchport.py
|
||||
lib/ansible/modules/network/nxos/nxos_udld.py
|
||||
lib/ansible/modules/network/nxos/nxos_udld_interface.py
|
||||
lib/ansible/modules/network/nxos/nxos_vlan.py
|
||||
lib/ansible/modules/network/nxos/nxos_vpc.py
|
||||
lib/ansible/modules/network/nxos/nxos_vpc_interface.py
|
||||
lib/ansible/modules/network/nxos/nxos_vrf.py
|
||||
lib/ansible/modules/network/nxos/nxos_vrf_af.py
|
||||
lib/ansible/modules/network/nxos/nxos_vrf_interface.py
|
||||
lib/ansible/modules/network/nxos/nxos_vrrp.py
|
||||
lib/ansible/modules/network/nxos/nxos_vtp_domain.py
|
||||
lib/ansible/modules/network/nxos/nxos_vtp_password.py
|
||||
lib/ansible/modules/network/nxos/nxos_vtp_version.py
|
||||
lib/ansible/modules/network/nxos/nxos_vxlan_vtep.py
|
||||
lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py
|
||||
lib/ansible/modules/network/panos/panos_nat_policy.py
|
||||
lib/ansible/modules/network/snmp_facts.py
|
||||
lib/ansible/modules/notification/hall.py
|
||||
|
|
Loading…
Reference in a new issue