X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fwhohosts.rb;h=3192bb731c82c2f9890e0981d4b686067c41c2a8;hb=b2a6f14054fb5d39f29be46e49cb456fb5f43b5b;hp=b55204ac8fdd17712ae920f509c864288301d088;hpb=8dffe43c9cc83593ab06294e82e1a2654639179a;p=mirror%2Fdsa-puppet.git diff --git a/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb b/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb index b55204ac8..3192bb731 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb @@ -1,16 +1,14 @@ +require 'puppet/file_system' + module Puppet::Parser::Functions newfunction(:whohosts, :type => :rvalue) do |args| require 'ipaddr' require 'yaml' ipAddrs = args[0] - yamlfile = args[1] - parser = Puppet::Parser::Parser.new(environment) - parser.watch_file(yamlfile) - - $KCODE = 'utf-8' ans = {"name" => "unknown"} + yamlfile = Puppet::Parser::Files.find_file('debian_org/misc/hoster.yaml', compiler.environment) yaml = YAML.load_file(yamlfile) ipAddrs.each do |addr|