Issue #12774 has been reported by R.I. Pienaar.

----------------------------------------
Bug #12774: Confusing logging when onlyif prevents an exec from running
https://projects.puppetlabs.com/issues/12774

Author: R.I. Pienaar
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Given the code in:

<pre>
exec{"/bin/true": }

exec{"/usr/bin/cowthink meh":
    logoutput => true,
    onlyif    => "/bin/true",
    subscribe => Exec["/bin/true"],
    refreshonly => true
}
</pre>

I get the output 

<pre>
notice: /Stage[main]//Exec[/bin/true]/returns: executed successfully
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]/returns:  _____ 
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]/returns: ( meh )
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]/returns:  ----- 
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]/returns:         o   ^__^
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]/returns:          o  
(oo)\_______
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]/returns:             (__)\    
   )\/\
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]/returns:                 
||----w |
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]/returns:                 ||   
  ||
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]: Triggered 'refresh' from 1 
events
notice: Finished catalog run in 0.21 seconds
</pre>

which is all fine,

if I change the onlyif to:

<pre>
onlyif    => "/bin/false",
</pre>

This prevents the exec from actually running but the logging I would get is:

<pre>
notice: /Stage[main]//Exec[/bin/true]/returns: executed successfully
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]: Triggered 'refresh' from 1 
events
</pre>

The "Triggered 'refresh' from 1 events' suggests that the exec is being run, 
when actually its being skipped due to the onlyif condition.

If I removed the logoutput from the first bit of code here the output from both 
runs would be identical:

With onlyif => "/bin/true" and no logoutput:

<pre>
notice: /Stage[main]//Exec[/bin/true]/returns: executed successfully
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]: Triggered 'refresh' from 1 
events
</pre>

With onlyif => "/bin/false" and no logoutput:

<pre>
notice: /Stage[main]//Exec[/bin/true]/returns: executed successfully
notice: /Stage[main]//Exec[/usr/bin/cowthink meh]: Triggered 'refresh' from 1 
events
</pre>

They're identical and don't actually tell the user what is happening


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to