summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/knife/ssh.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index 8e13425f82..885ebc4faa 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -576,8 +576,13 @@ class Chef
configure_user
configure_password
@password = config[:ssh_password] if config[:ssh_password]
- configure_ssh_identity_file
- configure_ssh_gateway_identity
+
+ # If a password was not given, check for SSH identity file.
+ if !@password
+ configure_ssh_identity_file
+ configure_ssh_gateway_identity
+ end
+
configure_gateway
configure_session