summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/scope.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/scope.rb')
-rw-r--r--lib/puppet/parser/scope.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 3a87f964b..9d84c7e65 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -57,7 +57,7 @@ class Puppet::Parser::Scope
rescue RuntimeError => e
location = (options[:file] && options[:line]) ? " at #{options[:file]}:#{options[:line]}" : ''
warning "Could not look up qualified variable '#{name}'; #{e.message}#{location}"
- :undefined
+ nil
end
elsif ephemeral_include?(name) or table.include?(name)
# We can't use "if table[name]" here because the value might be false
@@ -69,7 +69,7 @@ class Puppet::Parser::Scope
elsif parent
parent[name,options.merge(:dynamic => (dynamic || options[:dynamic]))]
else
- :undefined
+ nil
end
end
@@ -92,7 +92,7 @@ class Puppet::Parser::Scope
end
def include?(name)
- self[name] != :undefined
+ ! self[name].nil?
end
# Is the value true? This allows us to control the definition of truth
@@ -244,7 +244,11 @@ class Puppet::Parser::Scope
end
def undef_as(x,v)
- (v == :undefined) ? x : (v == :undef) ? x : v
+ if v.nil? or v == :undef
+ x
+ else
+ v
+ end
end
def qualified_scope(classname)