Issue #15329 has been updated by Reid Vandewiele.
With regards to the potential addition of a `nothing` kind of keyword, after
thinking about this for awhile I realized that I already use a largely
functional equivalent for passing around "nothing" in the Puppet DSL. I use an
empty array, `[ ]`. Here's a contrived example:
<pre>
class amanda (
$server_package = 'amanda-server',
$client_package = 'amanda-client'
) {
package { $server_package:
ensure => installed,
before => Package[$client_package],
}
package { $client_package:
ensure => installed,
}
}
case $::osfamily {
'Debian': {
# In my Debian environment, I use a Zmanda provide the amanda service
$server = 'zmanda-backup'
# zmanda-backup provides client AND server, so client should be "nothing"
$client = [ ]
default: {
$server = undef
$client = undef
}
}
class { 'amanda':
server_package => $server,
client_package => $client,
}
</pre>
Is this the kind of usage you envision a separate "nothing" keyword being able
to provide? If it is, would adding a "nothing" keyword that simply evaluated to
an empty array provide that functionality, or is there more complexity that
needs to be carried?
----------------------------------------
Bug #15329: Puppet lacks a proper "undefined" value
https://projects.puppetlabs.com/issues/15329#change-78423
Author: Pieter van de Bruggen
Status: Accepted
Priority: Normal
Assignee: Henrik Lindberg
Category:
Target version:
Affected Puppet version:
Keywords: backlog
Branch:
$y = undef
notice($y == "") # true
notice($x == $y) # true
notice($x == "") # true
Recent changes in the Puppet DSL made equality commutative (good!), but in
doing so broke work-arounds for actually testing for the difference between an
undefined and "empty" value. The most logical fix would be to equate Puppet's
`undef` with Ruby's `nil`.
--
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.