Commit 3de544da by Sheng

Append key to entries directly

parent 02461259
...@@ -56,7 +56,9 @@ class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy): ...@@ -56,7 +56,9 @@ class AutoAddPolicy(paramiko.client.MissingHostKeyPolicy):
logging.info( logging.info(
'Adding {} host key for {}'.format(keytype, hostname) 'Adding {} host key for {}'.format(keytype, hostname)
) )
client._host_keys.add(hostname, keytype, key) client._host_keys._entries.append(
paramiko.hostkeys.HostKeyEntry([hostname], key)
)
with open(client._host_keys_filename, 'a') as f: with open(client._host_keys_filename, 'a') as f:
f.write('{} {} {}\n'.format( f.write('{} {} {}\n'.format(
......
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