diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-11-21 23:22:53 +0100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-12-29 18:45:47 +1100 |
commit | 53869e99149be0f60b4e415d061a76ab5421eadb (patch) | |
tree | 0e69b24905344745928909f3b5ae0c5a195772a5 /spec/integration/ssl/certificate_request.rb | |
parent | d921c459c14f7460fb209dea3b9194c91fee9fd1 (diff) | |
download | puppet-53869e99149be0f60b4e415d061a76ab5421eadb.tar.gz puppet-53869e99149be0f60b4e415d061a76ab5421eadb.tar.xz puppet-53869e99149be0f60b4e415d061a76ab5421eadb.zip |
Fix #2818 - scope variable assigned with undef are not "undef"
The following manifest doesn't work:
$foo = undef
case $foo {
undef: { notice("undef") }
default: { notice("defined") }
}
This is because "undef" scope variable are returned as an empty
string.
This patch introduces a behavior change:
Now, unassigned variable usage returns also undef.
This might produce some issues in existing manifests, although
care has been taken to allow correct behavior in the most commonly
used patterns.
For instance:
case $bar {
undef: { notice("undef") }
default: { notice("defined") }
}
will print "undef".
But matching undef in case/selector/if will also match "".
case $bar {
"": { notice("empty") }
default: { notice("defined") }
}
will print "empty".
Of course "" doesn't match undef :-)
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/integration/ssl/certificate_request.rb')
0 files changed, 0 insertions, 0 deletions