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
pull/14535/head
Peter Sprygada 8 years ago
parent 0d3c0515c0
commit 91f3558c64

@ -127,7 +127,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']

Loading…
Cancel
Save