在python中使用结构库并形成ssh连接时出现以下错误
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1923, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1923, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
答案 0 :(得分:0)
通过使用fabric python库中的连接来解决问题。默认情况下,在缓存中存储所有ip,然后在脚本结束时使用disconnect_all()方法从所有远程机器断开连接。