summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2019-11-02 13:56:27 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2019-11-03 09:44:25 +0530
commit3b1c6279fb944249b03986525636c8edd5e3c73a (patch)
tree6998c39391e23576a08ac99d05acc9fefafc84ba
parent52734604df488abd25db7264573bae1ccbcde377 (diff)
downloadchef-3b1c6279fb944249b03986525636c8edd5e3c73a.tar.gz
Fix TypeError: no implicit conversion of nil into String
 - Now showing relevant logs for config.d configuration files. Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r--lib/chef/knife/config_get.rb3
-rw-r--r--spec/integration/knife/config_get_spec.rb7
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/chef/knife/config_get.rb b/lib/chef/knife/config_get.rb
index b07bef9a36..c194188d2a 100644
--- a/lib/chef/knife/config_get.rb
+++ b/lib/chef/knife/config_get.rb
@@ -47,9 +47,10 @@ class Chef
if wcl.config_location
loading_from("configuration", wcl.config_location)
end
+
if Chef::Config[:config_d_dir]
wcl.find_dot_d(Chef::Config[:config_d_dir]).each do |path|
- loading_from(".d/ configuration", wcl.config_location)
+ loading_from(".d/ configuration", path)
end
end
end
diff --git a/spec/integration/knife/config_get_spec.rb b/spec/integration/knife/config_get_spec.rb
index 98fefd729f..83150a39b8 100644
--- a/spec/integration/knife/config_get_spec.rb
+++ b/spec/integration/knife/config_get_spec.rb
@@ -110,6 +110,13 @@ describe "knife config get", :workstation do
it { is_expected.to match(/^node_name:\s+one$/) }
end
+ context "with a config dot d files" do
+ before { file(".chef/config.d/abc.rb", "node_name 'one'\n") }
+
+ it { is_expected.to match(%r{^Loading from .d/ configuration file .*/#{File.basename(path_to("."))}/.chef/config.d/abc.rb$}) }
+ it { is_expected.to match(/^node_name:\s+one$/) }
+ end
+
context "with a credentials file and CHEF_HOME" do
before do
file(".chef/credentials", "[default]\nclient_name = \"three\"\n")