Issue #13246 has been updated by Nick Fagerlund.
Garrett, can you attach a manifest that proves this doesn't work? The code
around line 106 of exec looks like it does exactly what it says:
if log = @resource[:logoutput]
case log
when :true
log = @resource[:loglevel]
when :on_failure
unless self.should.include?(@status.exitstatus.to_s)
log = @resource[:loglevel]
else
log = :false
end
end
unless log == :false
@output.split(/\n/).each { |line|
self.send(log, line)
}
end
end
That `self.send(log, line)` call gets whatever you specified in the logoutput
attribute, unless it was `true` or `on_failure` in which case it reads from the
loglevel metaparameter.
----------------------------------------
Bug #13246: exec's logoutput attribute does not accept valid log levels, and
should, according to our documentation
https://projects.puppetlabs.com/issues/13246#change-57623
Author: Garrett Honeycutt
Status: Unreviewed
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version: 2.7.9
Keywords:
Branch:
Our doc's read that we support specifying a log level, though the functionality
is missing.
<http://docs.puppetlabs.com/references/stable/type.html#exec>
<pre>
logoutput
Whether to log output. Defaults to logging output at the loglevel for the
exec resource. Use on_failure to only log the output when the command reports
an error. Values are true, false, on_failure, and any legal log level. Valid
values are true, false, on_failure.
</pre>
<https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type/exec.rb#L182>
<pre>
newparam(:logoutput) do
desc "Whether to log output. Defaults to logging output at the
loglevel for the `exec` resource. Use *on_failure* to only
log the output when the command reports an error. Values are
**true**, *false*, *on_failure*, and any legal log level."
newvalues(:true, :false, :on_failure)
end
</pre>
--
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.