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
This commit is contained in:
parent
b72b14fdf2
commit
0d3c0515c0
1 changed files with 2 additions and 1 deletions
|
@ -57,7 +57,8 @@ class Cli(object):
|
||||||
try:
|
try:
|
||||||
self.shell.open(host, port=port, username=username, password=password)
|
self.shell.open(host, port=port, username=username, password=password)
|
||||||
except Exception, exc:
|
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):
|
def authorize(self):
|
||||||
passwd = self.module.params['auth_pass']
|
passwd = self.module.params['auth_pass']
|
||||||
|
|
Loading…
Reference in a new issue