Fix traceback error in IOS and IOSXR when ran with empty config (#62423)

* fix changelog

* Fix traceback error in IOS and IOSXR when ran without config (#62400)

* fixes issue 61321

* complete iosxr

* fix ios_vlans

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
(cherry picked from commit 7a5a5e7c87)
pull/62524/head
Sumit Jaiswal 5 years ago committed by Toshio Kuratomi
parent 37c64b3eb3
commit 28055bbf8f

@ -0,0 +1,3 @@
---
bugfixes:
- "Fix traceback error in IOS and IOSXR when ran with empty config (https://github.com/ansible/ansible/pull/62400)"

@ -389,7 +389,12 @@ def main():
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=InterfacesArgs.argument_spec, module = AnsibleModule(argument_spec=InterfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = Interfaces(module).execute_module() result = Interfaces(module).execute_module()

@ -348,7 +348,12 @@ def main():
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=L2_InterfacesArgs.argument_spec, module = AnsibleModule(argument_spec=L2_InterfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = L2_Interfaces(module).execute_module() result = L2_Interfaces(module).execute_module()

@ -426,7 +426,12 @@ def main():
Main entry point for module execution Main entry point for module execution
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=L3_InterfacesArgs.argument_spec, module = AnsibleModule(argument_spec=L3_InterfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = L3_Interfaces(module).execute_module() result = L3_Interfaces(module).execute_module()

@ -170,7 +170,11 @@ def main():
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',))]
module = AnsibleModule(argument_spec=LacpArgs.argument_spec, module = AnsibleModule(argument_spec=LacpArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = Lacp(module).execute_module() result = Lacp(module).execute_module()

@ -347,7 +347,12 @@ def main():
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=Lacp_InterfacesArgs.argument_spec, module = AnsibleModule(argument_spec=Lacp_InterfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = Lacp_Interfaces(module).execute_module() result = Lacp_Interfaces(module).execute_module()

@ -374,8 +374,14 @@ def main():
Main entry point for module execution Main entry point for module execution
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=Lag_interfacesArgs.argument_spec, module = AnsibleModule(argument_spec=Lag_interfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = Lag_interfaces(module).execute_module() result = Lag_interfaces(module).execute_module()
module.exit_json(**result) module.exit_json(**result)

@ -241,7 +241,11 @@ def main():
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',))]
module = AnsibleModule(argument_spec=Lldp_globalArgs.argument_spec, module = AnsibleModule(argument_spec=Lldp_globalArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = Lldp_global(module).execute_module() result = Lldp_global(module).execute_module()

@ -485,7 +485,12 @@ def main():
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=Lldp_InterfacesArgs.argument_spec, module = AnsibleModule(argument_spec=Lldp_InterfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = Lldp_Interfaces(module).execute_module() result = Lldp_Interfaces(module).execute_module()

@ -448,7 +448,12 @@ def main():
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=VlansArgs.argument_spec, module = AnsibleModule(argument_spec=VlansArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = Vlans(module).execute_module() result = Vlans(module).execute_module()

@ -349,7 +349,12 @@ def main():
Main entry point for module execution Main entry point for module execution
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=InterfacesArgs.argument_spec, module = AnsibleModule(argument_spec=InterfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = Interfaces(module).execute_module() result = Interfaces(module).execute_module()

@ -413,7 +413,12 @@ def main():
Main entry point for module execution Main entry point for module execution
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=L2_InterfacesArgs.argument_spec, module = AnsibleModule(argument_spec=L2_InterfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = L2_Interfaces(module).execute_module() result = L2_Interfaces(module).execute_module()

@ -408,7 +408,12 @@ def main():
Main entry point for module execution Main entry point for module execution
:returns: the result form module invocation :returns: the result form module invocation
""" """
required_if = [('state', 'merged', ('config',)),
('state', 'replaced', ('config',)),
('state', 'overridden', ('config',))]
module = AnsibleModule(argument_spec=L3_InterfacesArgs.argument_spec, module = AnsibleModule(argument_spec=L3_InterfacesArgs.argument_spec,
required_if=required_if,
supports_check_mode=True) supports_check_mode=True)
result = L3_Interfaces(module).execute_module() result = L3_Interfaces(module).execute_module()

Loading…
Cancel
Save