Merge pull request #17279 from privateip/shell

catches timeout error when connecting to remote host in shell
This commit is contained in:
Peter Sprygada 2016-08-29 08:47:48 -04:00 committed by GitHub
commit c16f34bf8e

View file

@ -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")