Issue #17105 has been updated by Nick Fagerlund.
Status changed from Unreviewed to Accepted
Narrowed it down a bit. Test code is `puppet apply -e 'class is_false
($is_false) {notice($is_false)} include is_false'` with `is_false::is_false:
false` in my hiera yaml.
lib/puppet/resource.rb @322:
Puppet::DataBinding.indirection.find(
"#{resource_type.name}::#{param}",
:environment => scope.environment.to_s,
:variables => Puppet::DataBinding::Variables.new(scope))
If you comment this out and replace it with "false," it actually works fine, so
we know the `find` call is somehow not passing back a proper `false` value.
lib/puppet/indirector/hiera.rb @11:
def find(request)
hiera.lookup(request.key, nil, request.options[:variables], nil, nil)
end
Comment out the guts of that and replace it with `false`, and bingo: `Error:
Must pass is_false to Class[Is_false] at line 1 on node magpie.lan`.
So the hiera call is returning a proper false value, and
`lookup_external_default_for` would do the right thing if it were receiving a
proper false value, but Puppet::DataBinding.indirection.find is somehow not
passing it through. I now hand this off to someone who can do something with
it.
----------------------------------------
Bug #17105: Hiera booleans are broken -- explicit false value registers as
lookup failure
https://projects.puppetlabs.com/issues/17105#change-74432
Author: Nick Fagerlund
Status: Accepted
Priority: Normal
Assignee:
Category: databinding
Target version: 3.0.x
Affected Puppet version: 3.0.1
Keywords:
Branch:
`/var/lib/hiera/common.yaml:`
---
ntp::disabled: false
`fake_classes.pp:`
class ntp ($disabled) { }
include ntp
This explodes! Although a `hiera ntp::disabled` call from the command line
returns the correct result, Puppet registers this as a failed lookup and bails
compilation with `Error: Must pass disabled to Class[Ntp]`. This doesn't happen
with `true`, just `false`.
I assume we're just doing an `if returned_value` or something somewhere, which
will fail on both `nil` (value not found) and `false` (explicit false value
found). We can't do that -- booleans are a core data type and Puppet should
definitely accept them from Hiera.
--
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.