mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
fixed error handling
This commit is contained in:
@@ -450,7 +450,8 @@ def apply_value_map(value_map, resource):
|
||||
def execute_config_command(commands, module):
|
||||
try:
|
||||
module.configure(commands)
|
||||
except ShellError, clie:
|
||||
except ShellError:
|
||||
clie = get_exception()
|
||||
module.fail_json(msg='Error sending CLI commands',
|
||||
error=str(clie), commands=commands)
|
||||
|
||||
@@ -479,7 +480,8 @@ def execute_show(cmds, module, command_type=None):
|
||||
response = module.execute(cmds, command_type=command_type)
|
||||
else:
|
||||
response = module.execute(cmds)
|
||||
except ShellError, clie:
|
||||
except ShellError:
|
||||
clie = get_exception()
|
||||
module.fail_json(msg='Error sending {0}'.format(command),
|
||||
error=str(clie))
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user