- From: Noah Kantrowitz <
>
- To:
- Subject: [chef] Re: Re: Re: Exiting a run mid way through
- Date: Mon, 16 Apr 2012 15:18:32 -0700
return aborts the current recipe during the compile phase, but it wouldn't
have any affect on later recipes or during run. Useful more for stuff like
per-platform guard clauses.
--Noah
On Apr 16, 2012, at 3:16 PM, AJ Christensen wrote:
>
I believe I've used 'return' in a run to halt its processing by the
>
recipe compiler, too, although you'll have to test it works as you
>
expect.
>
>
return ArgumentError unless node.foo.has_key? :bar
>
>
--AJ
>
>
On 17 April 2012 10:12, Noah Kantrowitz
>
<
>
>
wrote:
>
> Just raise an exception, it will abort the run.
>
>
>
> --Noah
>
>
>
> On Apr 16, 2012, at 1:18 PM, Kendrick Martin wrote:
>
>
>
>> Hello all,
>
>> I’m looking for a way to exit a chef run gracefully(including calling
>
>> handlers) if a specific resource is notified. I am using the reboot
>
>> handler used in the windows cookbook. I would like the chef run to stop
>
>> if this resource provider is called so a reboot can be processed. Is
>
>> there an easy way to accomplish this?
>
>>
>
>> Kendrick
>
>>
>
>
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
Archive powered by MHonArc 2.6.16.