[chef] Chef 11.6.0 - Chefspec test failures on template resource


Chronological Thread 
  • From: Pete Cheslock < >
  • To:
  • Subject: [chef] Chef 11.6.0 - Chefspec test failures on template resource
  • Date: Wed, 24 Jul 2013 14:37:35 -0400

Hey everyone, i noticed something today when running chefspec with chef 11.6.0 and dealing with the template resource.

I did see some larger changes to the template resource as part of the release and wondering if anyone knows what might be going on.
http://docs.opscode.com/release_notes.html#resource-template-attributes

I have a simple recipe and template (and specific chefspec test)  https://gist.github.com/petecheslock/999de67d5620e811a20c

In the gist you can see that the test fails with a odd error:
1) recipe::default should include correct content
Failure/Error: @chef_run.should create_file_with_content @file,
NameError:
undefined local variable or method `node' for #<Erubis::Context:0x007fccc30b9bf8>
# (erubis):3:in `block in evaluate'
# ./spec/default_spec.rb:20:in `block (2 levels) in <top (required)>'

If I converge the recipe - everything works as expected - and the file is written out with the correct value from the attribute.

If I run this with 11.4.4 the tests pass, but fail with 11.6.0

Reading the 11.6.0 release notes I know there are better ways to do this (that i'll be using) but i'm curious why it fails in this case as there are a bunch of templates that have things like:  <%= node["foo"]["bar"]["baz"] %>

Any ideas?



Archive powered by MHonArc 2.6.16.

§