summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-11-10 12:38:17 -0800
committerGitHub <noreply@github.com>2020-11-10 12:38:17 -0800
commit014328c06c470e4159f616876972811d745e1785 (patch)
treefe4b1e8c434274be503d2e1636639b1f665b96dd
parent4205df95a7622e3c01362e683653de15d42d6416 (diff)
parent02b674102e462750850013f349cf5b3b4d3e8e4a (diff)
downloadchef-014328c06c470e4159f616876972811d745e1785.tar.gz
Merge pull request #10608 from srb3/chef_client_config_fix
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--kitchen-tests/test/integration/end-to-end/_chef_client_config.rb4
-rw-r--r--lib/chef/resource/support/client.erb9
2 files changed, 6 insertions, 7 deletions
diff --git a/kitchen-tests/test/integration/end-to-end/_chef_client_config.rb b/kitchen-tests/test/integration/end-to-end/_chef_client_config.rb
index 7e0cc3fd15..4cc1459b7b 100644
--- a/kitchen-tests/test/integration/end-to-end/_chef_client_config.rb
+++ b/kitchen-tests/test/integration/end-to-end/_chef_client_config.rb
@@ -5,7 +5,7 @@ client_rb = if os.windows?
end
describe file(client_rb) do
- its("content") { should match(%r{chef_server_url = "https://localhost"}) }
- its("content") { should match(/chef_license = "accept"/) }
+ its("content") { should match(%r{chef_server_url "https://localhost"}) }
+ its("content") { should match(/chef_license "accept"/) }
its("content") { should match(/require 'aws-sdk'/) }
end
diff --git a/lib/chef/resource/support/client.erb b/lib/chef/resource/support/client.erb
index 483825d3ee..6507c74440 100644
--- a/lib/chef/resource/support/client.erb
+++ b/lib/chef/resource/support/client.erb
@@ -10,7 +10,6 @@
@https_proxy
@ftp_proxy
@log_level
- @log_location
@minimal_ohai
@named_run_list
@no_proxy
@@ -21,14 +20,14 @@
@policy_name
@ssl_verify_mode).each do |prop| -%>
<% next if instance_variable_get(prop).nil? || instance_variable_get(prop).empty? -%>
-<%=prop.delete_prefix("@") %> = <%= instance_variable_get(prop).inspect %>
+<%=prop.delete_prefix("@") %> <%= instance_variable_get(prop).inspect %>
<% end -%>
<%# log_location is special due to STDOUT/STDERR from String -> IO Object -%>
<% unless @log_location.nil? %>
- <% if @log_location.is_a? String && %w(STDOUT STDERR).include?(@log_location) -%>
-log_location = <%= @log_location %>
+ <% if @log_location.is_a?(String) && %w(STDOUT STDERR).include?(@log_location) -%>
+log_location <%= @log_location %>
<% else -%>
-log_location = <%= @log_location.inspect %>
+log_location <%= @log_location.inspect %>
<% end -%>
<% end -%>
<%# The code below is not DRY on purpose to improve readability -%>