- From: Peter Loron <
>
- To: "
" <
>
- Subject: [chef] Templates don't fail when values are missing
- Date: Mon, 15 Apr 2013 11:48:41 -0700
I have a large (hundreds of properties, dozens of templates) set of templates
I'm porting from Nant to Chef. The properties in the old system are scattered
across multiple files and while aggregating the properties into data bags and
adjusting the templates, I have missed some values.
The call in the recipe to merge each template with the properties from the
data bags works, but values that are not present in the hash are simply empty
in the generated template. The substitution fails silently.
For example, if I have this in the template:
<foobar value="<%= @property['foobar'] %>" />
… and the 'foobar' key/value pair is not present, I wind up with this in the
generated file:
<foobar value="" />
Is there any way to get Chef to throw a warning or error in this case?
Thanks.
-Pete
- [chef] Templates don't fail when values are missing, Peter Loron, 04/15/2013
Archive powered by MHonArc 2.6.16.