X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fwhohosts.rb;h=3192bb731c82c2f9890e0981d4b686067c41c2a8;hb=30be0f0db19c688a30cc568c80be00a6724bd1e2;hp=f98bf0ad050cd2c33a0857d2a29f3c7698ed0454;hpb=55a63628f8e7bbc120abc8378ae119243eb622ce;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 f98bf0ad0..3192bb731 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb @@ -1,15 +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] - #self.interp.newfile(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| @@ -29,6 +28,9 @@ module Puppet::Parser::Functions end end end + if not ans['longname'] + ans['longname'] = ans['name'] + end return ans end end