[chef] Re: raise_unless


Chronological Thread 
  • From: Andrew Shafer < >
  • To:
  • Subject: [chef] Re: raise_unless
  • Date: Thu, 15 Jul 2010 23:37:32 -0600


Someone told me I didn't explain what I was asking well enough, so here is an attempt to do that.

I have some configurations where there is not really a sensible default and I want to ensure the cookbook parameters are pushed down from another cookbook or role.

I want the opposite behavior of set_unless[:foo][:bar], I want raise_unless[:foo][:bar] to stop the run if node[:foo][:bar] is not set.

I monkey patched Chef::Node to make raise_unless work. There is some differences in the way node interacts with attributes between 0.8 and 0.9 that make it different between versions, but it's pretty straight forward.

I'm interested if other people see any use for this and if so, is there a better semantic or mechanism to accomplish it.


On Thu, Jul 15, 2010 at 8:15 AM, Andrew Shafer < "> > wrote:

I want cookbooks that mandate that something else set certain attributes as part of their contract.

I've been toying with a 'raise_unless' defined in node.rb for these attributes.

Does anyone else have concerns or opinions about this?





Archive powered by MHonArc 2.6.16.

§