mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-12 19:34:02 -07:00
fixes issues with authenticating using ssh-agent for ios devices
Exception was raised when trying to use ssh-agent for authentication to ios devices. This fix enables ssh-agent and enable use of password protected ssh keys. There is one additional fix to capture authentication exceptions nicely.
This commit is contained in:
parent
9c505e2fa9
commit
0a87651fc5
2 changed files with 10 additions and 2 deletions
|
@ -27,6 +27,7 @@ except ImportError:
|
|||
|
||||
try:
|
||||
import paramiko
|
||||
from paramiko.ssh_exception import AuthenticationException
|
||||
HAS_PARAMIKO = True
|
||||
except ImportError:
|
||||
HAS_PARAMIKO = False
|
||||
|
@ -111,6 +112,8 @@ class Shell(object):
|
|||
self.shell.settimeout(timeout)
|
||||
except socket.gaierror:
|
||||
raise ShellError("unable to resolve host name")
|
||||
except AuthenticationException:
|
||||
raise ShellError('Unable to authenticate to remote device')
|
||||
|
||||
if self.kickstart:
|
||||
self.shell.sendall("\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue