The branch, master has been updated
via 53869e99149be0f60b4e415d061a76ab5421eadb (commit)
from d921c459c14f7460fb209dea3b9194c91fee9fd1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 53869e99149be0f60b4e415d061a76ab5421eadb
Author: Brice Figureau <brice-...@daysofwonder.com>
Date: Sat Nov 21 23:22:53 2009 +0100
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-...@daysofwonder.com>
-----------------------------------------------------------------------
Summary of changes:
lib/puppet/parser/ast/leaf.rb | 7 +++-
spec/unit/parser/ast/arithmetic_operator.rb | 4 +-
spec/unit/parser/ast/comparison_operator.rb | 4 +-
spec/unit/parser/ast/leaf.rb | 49 +++++++++++++++++++++++---
test/language/ast/variable.rb | 2 +-
5 files changed, 54 insertions(+), 12 deletions(-)
hooks/post-receive
--
Puppet - System Automation