summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sprygada <psprygada@ansible.com>2016-02-17 14:12:50 +0000
committerPeter Sprygada <psprygada@ansible.com>2016-02-17 15:41:44 +0000
commite15daf186a23946c19bc0d279a2be5f3ee70ad1c (patch)
tree13d32e09d1890b71bede98d562a283251091ab19
parent9c4467303faf29c5f4f4043bb6f1cf8c6d711a59 (diff)
downloadansible-e15daf186a23946c19bc0d279a2be5f3ee70ad1c.tar.gz
minor bugfix that will catch connection errors in eos
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/eos.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/eos.py b/lib/ansible/module_utils/eos.py
index 36bf051fd0..2448c79af0 100644
--- a/lib/ansible/module_utils/eos.py
+++ b/lib/ansible/module_utils/eos.py
@@ -126,7 +126,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']