summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sprygada <psprygada@ansible.com>2016-02-17 14:14:24 +0000
committerPeter Sprygada <psprygada@ansible.com>2016-02-17 15:41:37 +0000
commit9c4467303faf29c5f4f4043bb6f1cf8c6d711a59 (patch)
tree0db7864f7dc4a2a677c04e3d67054684885cb55d
parentdf3f9345e1881fe22f075a623cb9a46f4fe26c63 (diff)
downloadansible-9c4467303faf29c5f4f4043bb6f1cf8c6d711a59.tar.gz
minor bugfix that will catch connection errors in ios
This commit fixes a situation where connection errors would be caught but no useful information display. The connection error is now caught and emitted in a call to fail_json
-rw-r--r--lib/ansible/module_utils/ios.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/ios.py b/lib/ansible/module_utils/ios.py
index 64a56a3a8e..6261c785b9 100644
--- a/lib/ansible/module_utils/ios.py
+++ b/lib/ansible/module_utils/ios.py
@@ -56,7 +56,8 @@ class Cli(object):
try:
self.shell.open(host, port=port, username=username, password=password)
except Exception, exc:
- self.module.fail_json('Failed to connect to {0}:{1} - {2}'.format(host, port, str(exc)))
+ msg = 'failed to connecto to %s:%s - %s' % (host, port, str(exc))
+ self.module.fail_json(msg=msg)
def authorize(self):
passwd = self.module.params['auth_pass']