diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-10-24 13:33:44 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-10-24 13:33:44 -0700 |
commit | adf1995120d81e9083e7b0650ad9afcab444aa85 (patch) | |
tree | b0fc3e24d2b08757d9addf1ae7491e57f1cf30c5 /lib | |
parent | 5d9ab649c4898bf4050ecb527e34a9071e4f10ab (diff) | |
parent | 8802793016eff0c543d69fafc807b81f425d689f (diff) | |
download | chef-adf1995120d81e9083e7b0650ad9afcab444aa85.tar.gz |
Merge pull request #2196 from ClogenyTechnologies/sid/fix-bootstrap-options-precedence
[knife-ec2]Command-line options do not take precedence over knife.rb configuration (#247)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/knife/bootstrap.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index a992cf5779..f159c9105b 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -280,14 +280,16 @@ class Chef ssh = Chef::Knife::Ssh.new ssh.ui = ui ssh.name_args = [ server_name, ssh_command ] - ssh.config[:ssh_user] = Chef::Config[:knife][:ssh_user] || config[:ssh_user] + + # command line arguments and config file values are now merged into config in Chef::Knife#merge_configs + ssh.config[:ssh_user] = config[:ssh_user] ssh.config[:ssh_password] = config[:ssh_password] - ssh.config[:ssh_port] = Chef::Config[:knife][:ssh_port] || config[:ssh_port] - ssh.config[:ssh_gateway] = Chef::Config[:knife][:ssh_gateway] || config[:ssh_gateway] - ssh.config[:forward_agent] = Chef::Config[:knife][:forward_agent] || config[:forward_agent] - ssh.config[:identity_file] = Chef::Config[:knife][:identity_file] || config[:identity_file] + ssh.config[:ssh_port] = config[:ssh_port] + ssh.config[:ssh_gateway] = config[:ssh_gateway] + ssh.config[:forward_agent] = config[:forward_agent] + ssh.config[:identity_file] = config[:identity_file] ssh.config[:manual] = true - ssh.config[:host_key_verify] = Chef::Config[:knife][:host_key_verify] || config[:host_key_verify] + ssh.config[:host_key_verify] = config[:host_key_verify] ssh.config[:on_error] = :raise ssh end |