X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fyamlinfo.rb;h=8ae486d350579e011b2b4cb4ae31958fd2a4dfce;hb=acc06f8a3b65391b44bbb3b56b17a18bab966c22;hp=f53014dee3a22c2f7dcaeda9fd746fa9be329605;hpb=80b0cc62b8ca834194819f486a7f2bf1ba23f61b;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 f53014dee..8ae486d35 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 = {} @@ -25,9 +24,6 @@ module Puppet::Parser::Functions 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| @@ -43,6 +39,7 @@ 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 = {}