We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I tried to set a bool property inside chef_client_config resource, like
the chef compilation fails with the following error:
template("/etc/cinc/client.rb") do action [:create] default_guard_interpreter :default source "/opt/cinc/embedded/lib/ruby/gems/2.7.0/gems/chef-16.16.13/lib/chef/resource/support/client.erb" declared_type :template cookbook_name "system-base" owner "root" group "root" local true variables {:chef_license=>"accept", :chef_server_url=>"chefzero://localhost:1", :event_loggers=>[], :exception_handlers=>[], :file_backup_path=>"/var/lib/chef", :file_cache_path=>"/var/chef/cache", :file_staging_uses_destdir=>nil, :formatters=>[], :http_proxy=>nil, :https_proxy=>nil, :ftp_proxy=>nil, :log_level=>:info, :log_location=>"/var/log/chef/client.log", :minimal_ohai=>false, :named_run_list=>nil, :no_proxy=>"", :node_name=>"wgao-redhat-79", :ohai_disabled_plugins=>[], :ohai_optional_plugins=>[], :pid_file=>"var/run/chef/client.pid", :policy_group=>nil, :policy_name=>nil, :report_handlers=>[], :ssl_verify_mode=>:verify_none, :start_handlers=>[], :additional_config=>nil} mode "0640" path "/etc/cinc/client.rb" verifications [] end Template Context: ----------------- on line #22 20: @policy_name 21: @ssl_verify_mode).each do |prop| -%> 22: <% next if instance_variable_get(prop).nil? || instance_variable_get(prop).empty? -%> 23: <%=prop.delete_prefix("@") %> <%= instance_variable_get(prop).inspect %> 24: <% end -%> System Info: ------------ chef_version=16.16.13 platform=redhat platform_version=7.9 ruby=ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux] program_name=/opt/cinc/bin/cinc-client executable=/opt/cinc/bin/cinc-client ================================================================================ Error executing action `create` on resource 'chef_client_config[Create client.rb]' ================================================================================ Chef::Mixin::Template::TemplateError ------------------------------------ undefined method `empty?' for false:FalseClass
This code looks like is from https://github.com/chef/chef/blob/main/lib/chef/resource/support/client.erb#L22
<% next if instance_variable_get(prop).nil? || instance_variable_get(prop).empty? -%>
Quick Ruby testing
irb(main):001:0> false.nil? => false irb(main):002:0> false.empty? NoMethodError: undefined method `empty?' for false:FalseClass from (irb):2 from /bin/irb:12:in `<main>' irb(main):003:0>
16.16.13
RHEL 7.9
See above Ruby test
See above inside issue description
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
When I tried to set a bool property inside chef_client_config resource, like
the chef compilation fails with the following error:
This code looks like is from
https://github.com/chef/chef/blob/main/lib/chef/resource/support/client.erb#L22
Quick Ruby testing
Chef Version
16.16.13
Platform Version
RHEL 7.9
Replication Case
See above Ruby test
Client Output
See above inside issue description
Stacktrace
See above inside issue description
The text was updated successfully, but these errors were encountered: