Issue #17775 has been updated by Stefan Schulte.
Hi Dan,
I guess this is expected behaviour. I believe if you do
<pre>
pupppet resource package no_such_package
</pre>
you obviously want to see
<pre>
package { "no_such_package":
ensure => absent
}
</pre>
so you dont want to ommit the ensure property. But for other properties one
might say it is saner to ommit absent properties. E.g. if you are on linux and
you specifiy
<pre>
puppet resource mount /boot
</pre>
You don't want to see blockdevice => absent, because it is not relevant. Or if
you query the host resource you do not see any host_aliases if they are not
specified, so you do not pollute the output.
----------------------------------------
Bug #17775: puppet resource removes any properties from its output whose value
is absent
https://projects.puppetlabs.com/issues/17775#change-77427
Author: Dan Bode
Status: Unreviewed
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version:
Keywords:
Branch:
the following code from Puppet::Resource
<pre>
380 def prune_parameters(options = {})
381 properties = resource_type.properties.map(&:name)
382
383 dup.collect do |attribute, value|
384 if value.to_s.empty? or Array(value).empty?
385 delete(attribute)
386 elsif value.to_s == "absent" and attribute.to_s != "ensure"
387 delete(attribute)
388 end
</pre>
removes any attributes from the output of the puppet resource command whose
value is absent. I noticed it while debugging a missing attribute (whose value
happened to be absent)
I am a little confused by what that code is intended to do. Is it possible that
!= should be an == ?
--
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.