diff options
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/parser/ast/function.rb | 1 | ||||
| -rw-r--r-- | lib/puppet/parser/ast/leaf.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/parser/functions/extlookup.rb | 16 |
3 files changed, 7 insertions, 12 deletions
diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb index 602016c75..74023f631 100644 --- a/lib/puppet/parser/ast/function.rb +++ b/lib/puppet/parser/ast/function.rb @@ -11,7 +11,6 @@ class Puppet::Parser::AST @settor = true def evaluate(scope) - # Make sure it's a defined function raise Puppet::ParseError, "Unknown function #{@name}" unless Puppet::Parser::Functions.function(@name) diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index 49cde63ca..090d75c4e 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -42,7 +42,7 @@ class Puppet::Parser::AST # The base string class. class String < AST::Leaf def evaluate(scope) - @value + @value.dup end def to_s diff --git a/lib/puppet/parser/functions/extlookup.rb b/lib/puppet/parser/functions/extlookup.rb index ee230e7ce..177d9aef8 100644 --- a/lib/puppet/parser/functions/extlookup.rb +++ b/lib/puppet/parser/functions/extlookup.rb @@ -99,19 +99,15 @@ module Puppet::Parser::Functions # this will result in /path/to/extdata/hosts/your.box.com.csv # being searched. # - # we parse the precedence here because the best place to specify - # it would be in site.pp but site.pp is only evaluated at startup - # so $fqdn etc would have no meaning there, this way it gets evaluated - # each run and has access to the right variables for that run - lookupvar('extlookup_precedence').each do |prec| - while prec =~ /%\{(.+?)\}/ - prec.gsub!(/%\{#{$1}\}/, lookupvar($1)) + # This is for back compatibility to interpolate variables with %. + # % interpolation is a workaround for a problem that has been fixed: Puppet variable + # interpolation at top scope used to only happen on each run + extlookup_precedence = lookupvar('extlookup_precedence').collect do |var| + var.gsub(/%\{(.+?)\}/) do |capture| + lookupvar($1) end - - extlookup_precedence << prec end - datafiles = Array.new # if we got a custom data file, put it first in the array of search files |
