summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/knife/bootstrap.rb4
-rw-r--r--spec/unit/knife/bootstrap_spec.rb8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 1da36db37f..926af64b4b 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -1001,8 +1001,8 @@ class Chef
config[key]
else
lookup_key = knife_config_key || key
- if Chef::Config[:knife].key?(lookup_key)
- Chef::Config[:knife][lookup_key]
+ if Chef::Config[:knife].key?(lookup_key) || config.key?(lookup_key)
+ Chef::Config[:knife][lookup_key] || config[lookup_key]
else
default
end
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index 13e7906de8..f92af74284 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -1002,7 +1002,7 @@ describe Chef::Knife::Bootstrap do
let(:expected_result) do
{
logger: Chef::Log, # not configurable
- max_wait_until_ready: 9999,
+ max_wait_until_ready: 9999.0,
connection_timeout: 9999,
user: "sshbob",
bastion_host: "mygateway.local",
@@ -1012,7 +1012,7 @@ describe Chef::Knife::Bootstrap do
keys_only: true,
key_files: ["/identity.pem", "/gateway.pem"],
sudo: false,
- verify_host_key: false,
+ verify_host_key: nil,
port: 9999,
non_interactive: true,
pty: true,
@@ -1056,7 +1056,7 @@ describe Chef::Knife::Bootstrap do
let(:expected_result) do
{
logger: Chef::Log, # not configurable
- max_wait_until_ready: 150, # cli
+ max_wait_until_ready: 150.0, # cli
connection_timeout: 120, # cli
user: "sshalice", # cli
password: "feta cheese", # cli
@@ -1067,7 +1067,7 @@ describe Chef::Knife::Bootstrap do
keys_only: false, # implied false from config password present
key_files: ["/identity.pem", "/gateway.pem"], # Config
sudo: true, # ccli
- verify_host_key: false, # Config
+ verify_host_key: nil, # Config
port: 12, # cli
non_interactive: true,
pty: true,