summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/extlookup.rb12
-rw-r--r--lib/puppet/parser/functions/fqdn_rand.rb2
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/puppet/parser/functions/extlookup.rb b/lib/puppet/parser/functions/extlookup.rb
index 5fbf26cec..9ffca59a7 100644
--- a/lib/puppet/parser/functions/extlookup.rb
+++ b/lib/puppet/parser/functions/extlookup.rb
@@ -91,9 +91,9 @@ This is for back compatibility to interpolate variables with %. % interpolation
raise Puppet::ParseError, ("extlookup(): wrong number of arguments (#{args.length}; must be <= 3)") if args.length > 3
- extlookup_datadir = undef_as('',lookupvar('::extlookup_datadir'))
+ extlookup_datadir = undef_as('',self['::extlookup_datadir'])
- extlookup_precedence = undef_as([],lookupvar('::extlookup_precedence')).collect { |var| var.gsub(/%\{(.+?)\}/) { lookupvar("::#{$1}") } }
+ extlookup_precedence = undef_as([],self['::extlookup_precedence']).collect { |var| var.gsub(/%\{(.+?)\}/) { self["::#{$1}"] } }
datafiles = Array.new
@@ -121,9 +121,9 @@ This is for back compatibility to interpolate variables with %. % interpolation
if result[0].length == 2
val = result[0][1].to_s
- # parse %{}'s in the CSV into local variables using lookupvar()
+ # parse %{}'s in the CSV into local variables using the current scope
while val =~ /%\{(.+?)\}/
- val.gsub!(/%\{#{$1}\}/, lookupvar($1))
+ val.gsub!(/%\{#{$1}\}/, self[$1])
end
desired = val
@@ -134,9 +134,9 @@ This is for back compatibility to interpolate variables with %. % interpolation
# Individual cells in a CSV result are a weird data type and throws
# puppets yaml parsing, so just map it all to plain old strings
desired = cells.map do |c|
- # parse %{}'s in the CSV into local variables using lookupvar()
+ # parse %{}'s in the CSV into local variables using the current scope
while c =~ /%\{(.+?)\}/
- c.gsub!(/%\{#{$1}\}/, lookupvar($1))
+ c.gsub!(/%\{#{$1}\}/, self[$1])
end
c.to_s
diff --git a/lib/puppet/parser/functions/fqdn_rand.rb b/lib/puppet/parser/functions/fqdn_rand.rb
index 93ab98bcd..668802e73 100644
--- a/lib/puppet/parser/functions/fqdn_rand.rb
+++ b/lib/puppet/parser/functions/fqdn_rand.rb
@@ -7,6 +7,6 @@ Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
$random_number_seed = fqdn_rand(30,30)") do |args|
require 'digest/md5'
max = args.shift
- srand(Digest::MD5.hexdigest([lookupvar('::fqdn'),args].join(':')).hex)
+ srand(Digest::MD5.hexdigest([self['::fqdn'],args].join(':')).hex)
rand(max).to_s
end