X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=files%2Fetc%2Fpuppet%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fwhohosts.rb;h=c2bda8c4aa05db1fdf7052d5ef4dbb0e427515cd;hb=49d45cfd8f6d14de2d29b1ff1750da69f88d7a14;hp=e31688bad966a9b08becba86906ad03462179040;hpb=d786f4ec40f28a617b962f753c1350e924f91f52;p=mirror%2Fdsa-puppet.git diff --git a/files/etc/puppet/lib/puppet/parser/functions/whohosts.rb b/files/etc/puppet/lib/puppet/parser/functions/whohosts.rb index e31688bad..c2bda8c4a 100644 --- a/files/etc/puppet/lib/puppet/parser/functions/whohosts.rb +++ b/files/etc/puppet/lib/puppet/parser/functions/whohosts.rb @@ -12,8 +12,8 @@ module Puppet::Parser::Functions ans = "unknown" yaml = YAML.load_file(yamlfile) - if (nodeinfo['ldap'].at(0)) and (nodeinfo['ldap'][0].has_key?('ipHostNumber')) - nodeinfo['ldap'][0]['ipHostNumber'].each do |addr| + if (nodeinfo['ldap'].has_key?('ipHostNumber')) + nodeinfo['ldap']['ipHostNumber'].each do |addr| yaml.keys.each do |hoster| yaml[hoster].each do |net| if IPAddr.new(net).include?(addr)