Commit 7b715bea by Sheng

Fixed AutoAddPolicy

parent 3165cf23
...@@ -56,7 +56,8 @@ class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy): ...@@ -56,7 +56,8 @@ class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy):
lock = threading.Lock() lock = threading.Lock()
def is_missing_host_key(self, client, hostname, key): def is_missing_host_key(self, client, hostname, key):
k = client._host_keys.lookup(hostname) k = client._system_host_keys.lookup(hostname) or \
client._host_keys.lookup(hostname)
if k is None: if k is None:
return True return True
host_key = k.get(key.get_name(), None) host_key = k.get(key.get_name(), None)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment