[chef] Re: 11.6 template partials don't support node refs?


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: 11.6 template partials don't support node refs?
  • Date: Fri, 23 Aug 2013 08:53:30 -0700


On Thursday, August 22, 2013 at 7:44 PM, wrote:

When using the 11.6 chef-solo client on Solaris x86, it appears that partials
with node attribute references no longer work. The same templates and partials
worked fine when using 11.4.

<snip>
Chef::Mixin::Template::TemplateError (Could not find a value for node. If you
are explicitly setting variables in a template, include a node variable if you
plan to use it.) on line #11:

9: The deployment "<b><%= @deployment_name %></b>" has been configured with
Solaris <%= node['platform_version'] %>
10:
11: <%= render "partial_linux_access.erb", :variables => {
12: :hostname => @hostname,
13: :ipaddress => @ipaddress,

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/mixin/template.rb:139:in
`rescue in _render_template'
</snip>

When I replace the node attribute references with references to passed
variables, the partials work fine.

Has anyone encountered this issue?
Please file a bug report.

In any case, this error message occurs because the instance variable is nil. Adding `:node => @node` to the variables you pass in should work around it.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§