diff options
author | Luke Kanies <luke@madstop.com> | 2008-05-20 10:19:10 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-05-20 10:19:10 -0500 |
commit | fe157f239a301abb52f81c62719355c8e50c970c (patch) | |
tree | 2ff683d14dbf5c95a99410fe1d12300368cf497e /lib/puppet/parser | |
parent | 3cb0d60d3d0870f1d9ac83e5dbeaa06d2888231f (diff) | |
parent | 84a787a2a764a5035f7cbb8d30f94fc601bed154 (diff) | |
download | puppet-fe157f239a301abb52f81c62719355c8e50c970c.tar.gz puppet-fe157f239a301abb52f81c62719355c8e50c970c.tar.xz puppet-fe157f239a301abb52f81c62719355c8e50c970c.zip |
Merge branch '0.24.x'
Conflicts:
CHANGELOG
spec/integration/defaults.rb
spec/integration/node/catalog.rb
spec/unit/rails.rb
spec/unit/type/mount.rb
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/compiler.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/functions.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/templatewrapper.rb | 9 |
4 files changed, 12 insertions, 3 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 8fba41121..d67b3d275 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -332,7 +332,7 @@ class Puppet::Parser::Compiler unless remaining.empty? fail Puppet::ParseError, - "Could not find object(s) %s" % remaining.collect { |o| + "Could not find resource(s) %s for overriding" % remaining.collect { |o| o.ref }.join(", ") end diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb index e0b60e161..93991275c 100644 --- a/lib/puppet/parser/functions.rb +++ b/lib/puppet/parser/functions.rb @@ -165,7 +165,7 @@ module Functions type is defined, either as a native type or a defined type, or whether a class is defined. This is useful for checking whether a class is defined and only including it if it is. This function can also test whether a resource has been defined, using resource references - (e.g., ``if defined(File['/tmp/myfile'] { ... }``). This function is unfortunately + (e.g., ``if defined(File['/tmp/myfile']) { ... }``). This function is unfortunately dependent on the parse order of the configuration when testing whether a resource is defined.") do |vals| result = false vals.each do |val| diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index f27c1c5c8..04ca41494 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -62,7 +62,7 @@ class Puppet::Parser::Interpreter # exception elsewhere and reuse the parser. If one doesn't # exist, then reraise. if @parsers[environment] - Puppet.err detail + Puppet.err(detail.to_s + "; using previously parsed manifests") else raise detail end diff --git a/lib/puppet/parser/templatewrapper.rb b/lib/puppet/parser/templatewrapper.rb index 7a8f74156..4790cea30 100644 --- a/lib/puppet/parser/templatewrapper.rb +++ b/lib/puppet/parser/templatewrapper.rb @@ -20,6 +20,15 @@ class Puppet::Parser::TemplateWrapper end end + # Should return true if a variable is defined, false if it is not + def has_variable?(name) + if @scope.lookupvar(name.to_s, false) != :undefined + true + else + false + end + end + # Ruby treats variables like methods, so we can cheat here and # trap missing vars like they were missing methods. def method_missing(name, *args) |