Issue #7877 has been reported by jared jennings.

----------------------------------------
Feature #7877: log output at err level when logoutput => on_failure
https://projects.puppetlabs.com/issues/7877

Author: jared jennings
Status: Unreviewed
Priority: Normal
Assignee: 
Category: exec
Target version: 
Affected Puppet version: 2.6.4
Keywords: 
Branch: 


I'm using an exec resource to run `pwck -r`, a utility which checks that 
everything in the passwd, shadow and group files is in good order. If it's not, 
pwck says what the problem is and exits with a nonzero exitcode. I want 
`pwck`'s output to stand out from all the routine changes Puppet is doing.

When I write this resource:
<pre>
exec { "pwck":
    command => "/usr/sbin/pwck -r",
    logoutput => on_failure,
}
</pre>

and I have a user foo whose home directory does not exist, I get the following 
Puppet output:

<pre>
notice: /Stage[main]/User::Valid/Exec[pwck]/returns: user 'foo': directory 
'/home/foo' does not exist
notice: /Stage[main]/User::Valid/Exec[pwck]/returns: pwck: no changes
err: /Stage[main]/User::Valid/Exec[pwck]/returns: change from notrun to 0 
failed: /usr/sbin/pwck -r returned 2 instead of one of [0] at 
/etc/puppet/modules/user/manifests/valid.pp:11
</pre>

I want the output from pwck to be at the err loglevel, not the notice loglevel.



-- 
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