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>
This commit is contained in:
Sumit Jaiswal 2019-09-17 18:24:50 +05:30 committed by GitHub
parent c1126afbfb
commit 7a5a5e7c87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 59 additions and 0 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()