Fixing nxos_igmp_interface (#5010)
This commit is contained in:
parent
b6c07bc9e9
commit
3c257688bc
1 changed files with 24 additions and 0 deletions
|
@ -944,6 +944,19 @@ def execute_show(cmds, module, command_type=None):
|
|||
clie = get_exception()
|
||||
module.fail_json(msg='Error sending {0}'.format(command),
|
||||
error=str(clie))
|
||||
except AttributeError:
|
||||
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:
|
||||
module.cli.add_commands(cmds, raw=True)
|
||||
response = module.cli.run_commands()
|
||||
except ShellError:
|
||||
clie = get_exception()
|
||||
module.fail_json(msg='Error sending {0}'.format(cmds),
|
||||
error=str(clie))
|
||||
return response
|
||||
|
||||
|
||||
|
@ -1223,6 +1236,15 @@ def execute_config_command(commands, module):
|
|||
clie = get_exception()
|
||||
module.fail_json(msg='Error sending CLI commands',
|
||||
error=str(clie), commands=commands)
|
||||
except AttributeError:
|
||||
try:
|
||||
commands.insert(0, 'configure')
|
||||
module.cli.add_commands(commands, output='config')
|
||||
module.cli.run_commands()
|
||||
except ShellError:
|
||||
clie = get_exception()
|
||||
module.fail_json(msg='Error sending CLI commands',
|
||||
error=str(clie), commands=commands)
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -1388,6 +1410,8 @@ def main():
|
|||
execute_config_command(cmds, module)
|
||||
changed = True
|
||||
end_state = get_igmp_interface(module, interface)
|
||||
if 'configure' in cmds:
|
||||
cmds.pop(0)
|
||||
|
||||
results['proposed'] = proposed
|
||||
results['existing'] = existing_copy
|
||||
|
|
Loading…
Reference in a new issue