Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Made the connection routine only load the known host keys file when t…
…he reject_unknown_keys flag is set.
  • Loading branch information
Patrick J. McNerthney committed May 8, 2009
1 parent a8026f2 commit 08ad1c4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fabric/network.py
Expand Up @@ -107,10 +107,11 @@ def connect(user, host, port):

# Init client
client = ssh.SSHClient()
# Load known host keys (e.g. ~/.ssh/known_hosts)
client.load_system_host_keys()
# Unless user specified not to, accept/add new, unknown host keys
if not env.reject_unknown_keys:
if env.reject_unknown_keys:
# Load known host keys (e.g. ~/.ssh/known_hosts)
client.load_system_host_keys()
else:
# Unless user specified not to, accept/add new, unknown host keys
client.set_missing_host_key_policy(ssh.AutoAddPolicy())

#
Expand Down

0 comments on commit 08ad1c4

Please sign in to comment.