summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/ast')
-rw-r--r--lib/puppet/parser/ast/casestatement.rb4
-rw-r--r--lib/puppet/parser/ast/ifstatement.rb3
-rw-r--r--lib/puppet/parser/ast/selector.rb3
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/puppet/parser/ast/casestatement.rb b/lib/puppet/parser/ast/casestatement.rb
index 64298cac3..ed1bb8aa3 100644
--- a/lib/puppet/parser/ast/casestatement.rb
+++ b/lib/puppet/parser/ast/casestatement.rb
@@ -11,6 +11,8 @@ class Puppet::Parser::AST
# Short-curcuit evaluation. Return the value of the statements for
# the first option that matches.
def evaluate(scope)
+ level = scope.ephemeral_level
+
value = @test.safeevaluate(scope)
retvalue = nil
@@ -32,7 +34,7 @@ class Puppet::Parser::AST
Puppet.debug "No true answers and no default"
return nil
ensure
- scope.unset_ephemeral_var
+ scope.unset_ephemeral_var(level)
end
def each
diff --git a/lib/puppet/parser/ast/ifstatement.rb b/lib/puppet/parser/ast/ifstatement.rb
index 9d52123b6..d84445bbd 100644
--- a/lib/puppet/parser/ast/ifstatement.rb
+++ b/lib/puppet/parser/ast/ifstatement.rb
@@ -16,6 +16,7 @@ class Puppet::Parser::AST
# else if there's an 'else' setting, evaluate it.
# the first option that matches.
def evaluate(scope)
+ level = scope.ephemeral_level
value = @test.safeevaluate(scope)
# let's emulate a new scope for each branches
@@ -30,7 +31,7 @@ class Puppet::Parser::AST
end
end
ensure
- scope.unset_ephemeral_var
+ scope.unset_ephemeral_var(level)
end
end
end
diff --git a/lib/puppet/parser/ast/selector.rb b/lib/puppet/parser/ast/selector.rb
index ce834b63b..cc468a536 100644
--- a/lib/puppet/parser/ast/selector.rb
+++ b/lib/puppet/parser/ast/selector.rb
@@ -12,6 +12,7 @@ class Puppet::Parser::AST
# Find the value that corresponds with the test.
def evaluate(scope)
+ level = scope.ephemeral_level
# Get our parameter.
paramvalue = @param.safeevaluate(scope)
@@ -37,7 +38,7 @@ class Puppet::Parser::AST
self.fail Puppet::ParseError, "No matching value for selector param '%s'" % paramvalue
ensure
- scope.unset_ephemeral_var
+ scope.unset_ephemeral_var(level)
end
def to_s