X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fyamlinfo.rb;h=6590d62530d4bb5383ae0ca65a27c0ff26b45109;hb=e50cda3666f187a73d78a32a526c81146b4f1602;hp=0c64b22e8841a6e82f9bab1ca981658db7f03406;hpb=701beccf8b29d82f4224666e8404c1721a622661;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 0c64b22e8..6590d6253 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/yamlinfo.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/yamlinfo.rb @@ -1,8 +1,9 @@ +require 'puppet/file_system' + module Puppet::Parser::Functions newfunction(:yamlinfo, :type => :rvalue) do |args| host = args[0] - yamlfile = args[1] read_yaml = lambda { |yaml, host| results = {} @@ -22,11 +23,6 @@ module Puppet::Parser::Functions end end - results['mail_port'] = '' - results['smarthost'] = '' - results['heavy_exim'] = '' - results['smarthost_port'] = 587 - if yaml['host_settings'].kind_of?(Hash) yaml['host_settings'].each_pair do |property, values| if values.kind_of?(Hash) @@ -41,11 +37,12 @@ module Puppet::Parser::Functions require 'yaml' + yamlfile = Puppet::Parser::Files.find_file('debian_org/misc/local.yaml', compiler.environment) yaml = YAML.load_file(yamlfile) ret = {} if host == '*' - Dir.entries('/var/lib/puppet/yaml/node/').each do |fname| + Dir.entries('/var/lib/puppet/yaml/facts/').each do |fname| next unless fname =~ /(.*)\.yaml$/ host_name = $1 ret[host_name] = read_yaml.call(yaml, host_name)