Issue #6621 has been updated by Oliver Hookins.
I'm not sure. I need to ruminate on this further.
Part of the problem is this:
<pre>
define test($var) {
if $var {
notice "$name is true"
}
else {
notice "$name is false"
}
}
test { 'foo':
var => undef;
}
</pre>
This is not allowed as undef is not a valid value to be passed in (unlike nil
in Ruby). So perhaps it is not so much a case of "nil is needed", as much as
"undef needs to really behave like nil" (or more accurately, undef needs to be
accepted as a valid undefined value).
----------------------------------------
Feature #6621: Provide a nil type in the Puppet language
https://projects.puppetlabs.com/issues/6621
Author: Oliver Hookins
Status: Unreviewed
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version: 2.6.5
Keywords:
Branch:
Currently there is no way to semantically convey the concept of nil, as Ruby
understands it.
nil currently evaluates to true and is internally converted to a string 'nil',
and '' evaluates (somewhat confusingly) to false. However, the empty string is
a permissible configuration value whereas nil inherently is not. Furthermore
non-empty strings evaluate to true unlike the empty string.
My use case, to put it very simply, is to work around some limitations of
communicating information between the external node classifier interface and
Puppet itself, since once you pass a nil value through the interface to Puppet,
nil loses its semantic value.
--
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.