如果失败:
ssh = paramiko.SSHClient()
ssh.connect( host, username = USER , pkey = MY_KEY, timeout = 2)
我得到如下回溯:
File "<stdin>", line 1, in <module>
File "<stdin>", line 7, in bs_process
File "/usr/lib/python2.7/site-packages/paramiko/client.py", line 282, in connect
for (family, socktype, proto, canonname, sockaddr) in socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known
我不知道 Paramiko 会因错误的连接尝试而引发什么样的错误。哪些是异常类,如何导入它们?