From f5bcd38380166f3a78fdd23bd0f91d5175162630 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 4 Apr 2016 08:19:31 -0400 Subject: [PATCH] adds additional details in exception handling to ios shared module --- lib/ansible/module_utils/ios.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/ios.py b/lib/ansible/module_utils/ios.py index e61dd93ca8..ab194a7696 100644 --- a/lib/ansible/module_utils/ios.py +++ b/lib/ansible/module_utils/ios.py @@ -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)