catches timeout error when connecting to remote host in shell
This will now catch a timeout error when shell attempts to open the connection to the remove device and gracefully raise it as a ShellError
This commit is contained in:
parent
4b679ffd84
commit
820260b22d
1 changed files with 5 additions and 0 deletions
|
@ -106,6 +106,11 @@ class Shell(object):
|
||||||
raise ShellError("unable to resolve host name")
|
raise ShellError("unable to resolve host name")
|
||||||
except AuthenticationException:
|
except AuthenticationException:
|
||||||
raise ShellError('Unable to authenticate to remote device')
|
raise ShellError('Unable to authenticate to remote device')
|
||||||
|
except socket.error:
|
||||||
|
exc = get_exception()
|
||||||
|
if exc.errno == 60:
|
||||||
|
raise ShellError('timeout trying to connect to host')
|
||||||
|
raise
|
||||||
|
|
||||||
if self.kickstart:
|
if self.kickstart:
|
||||||
self.shell.sendall("\n")
|
self.shell.sendall("\n")
|
||||||
|
|
Loading…
Reference in a new issue