On Fri, May 20, 2011 at 9:33 AM, Luke Kanies <[email protected]> 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?
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.
You should probably be testing that Configurer#run raises the exception,
> rather than catches it.
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.