On May 20, 2011, at 12:08 PM, Nigel Kersten wrote:

> 
> 
> On Fri, May 20, 2011 at 9:33 AM, Luke Kanies <l...@puppetlabs.com> wrote:
> On May 20, 2011, at 8:36 AM, Nigel Kersten wrote:
> 
>> So it turns out that we've never actually had failed pre/post commands cause 
>> runs to fail, even though the tests appear to be testing the right thing.
>> 
>>       it "should fail if the command fails" do
>>         Puppet.settings[:prerun_command] = "/my/command"
>>         Puppet::Util.expects(:execute).raises Puppet::ExecutionFailure
>>   
>>         lambda { @agent.execute_prerun_command }.should 
>> raise_error(Puppet::Configurer::CommandHookError)
>>       end
>>     end
>> 
>> We do actually raise that error. We just happen to rescue it as well, and 
>> continue on.
>> 
>> I have a patch to resolve this, but I'm unsure what we should actually be 
>> testing to ensure this problem doesn't crop up in the future. Should I be 
>> checking the report status instead?
> 
> 
> It looks like we actually have a logic bug in Configurer#run - it's logging 
> on errors in prepare(), but not failing on them, which it really should do.
> 
> Do you agree that we should still try and send reports when pre/post commands 
> run though?

Reports should be sent every time, no matter what.  Any failure that results in 
a report not being sent should be considered catastophic.

> I'm torn on this. It's good to get info centrally about this sort of thing, 
> but at the same time, it's useful to be able to use your prerun_command as a 
> Big Red Button to stop your puppet client completely based upon dynamic info.


That sounds more like needing workflow flexibility, but yeah, we need some way 
to give people the ability not to run Puppet if they want.

-- 
Morgan's Second Law:
   To a first approximation all appointments are canceled.
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   http://about.me/lak



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to