X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fyamlinfo.rb;h=42a47959adf1713131675ef2db3fddc73a1b426a;hb=30be0f0db19c688a30cc568c80be00a6724bd1e2;hp=b38f5d56a3793e4f4365686f8d747ff97bfac587;hpb=c2d68a937252561e125c130131697de528638b70;p=mirror%2Fdsa-puppet.git diff --git a/modules/puppetmaster/lib/puppet/parser/functions/yamlinfo.rb b/modules/puppetmaster/lib/puppet/parser/functions/yamlinfo.rb index b38f5d56a..42a47959a 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/yamlinfo.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/yamlinfo.rb @@ -1,10 +1,9 @@ +require 'puppet/file_system' + module Puppet::Parser::Functions newfunction(:yamlinfo, :type => :rvalue) do |args| host = args[0] - yamlfile = args[1] - parser = Puppet::Parser::Parser.new(environment) - parser.watch_file(yamlfile) read_yaml = lambda { |yaml, host| results = {} @@ -42,8 +41,8 @@ module Puppet::Parser::Functions } require 'yaml' - $KCODE = 'utf-8' + yamlfile = Puppet::Parser::Files.find_file('debian_org/misc/local.yaml', compiler.environment) yaml = YAML.load_file(yamlfile) ret = {}