diff options
author | Peter Sprygada <psprygada@ansible.com> | 2016-02-17 14:12:50 +0000 |
---|---|---|
committer | Peter Sprygada <psprygada@ansible.com> | 2016-02-17 15:41:44 +0000 |
commit | e15daf186a23946c19bc0d279a2be5f3ee70ad1c (patch) | |
tree | 13d32e09d1890b71bede98d562a283251091ab19 | |
parent | 9c4467303faf29c5f4f4043bb6f1cf8c6d711a59 (diff) | |
download | ansible-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.py | 3 |
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'] |