adds additional details in exception handling to ios shared module

pull/4420/head
Peter Sprygada 2016-04-04 08:19:31 -04:00
parent 008395eda2
commit f5bcd38380
1 changed files with 2 additions and 0 deletions

View File

@ -127,6 +127,8 @@ class NetworkModule(AnsibleModule):
def execute(self, commands, **kwargs):
try:
return self.connection.send(commands, **kwargs)
except ShellError, exc:
self.fail_json(msg=exc.message, command=exc.command)
except Exception, exc:
self.fail_json(msg=exc.message, commands=commands)