X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fwhohosts.rb;h=c2bda8c4aa05db1fdf7052d5ef4dbb0e427515cd;hb=48143e4a3da865ec35a02407723ee995f59f3413;hp=2835cef2d3f8d8ea0b62a4bd679c279db90a32e5;hpb=af54a28ce3583c22c02a9e59277bb173fb1704f1;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 2835cef2d..c2bda8c4a 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb @@ -15,11 +15,9 @@ module Puppet::Parser::Functions if (nodeinfo['ldap'].has_key?('ipHostNumber')) nodeinfo['ldap']['ipHostNumber'].each do |addr| yaml.keys.each do |hoster| - if yaml[hoster].has_key?'netrange' - yaml[hoster]['netrange'].each do |net| - if IPAddr.new(net).include?(addr) - return hoster - end + yaml[hoster].each do |net| + if IPAddr.new(net).include?(addr) + ans = hoster end end end @@ -28,6 +26,3 @@ module Puppet::Parser::Functions return ans end end -# vim:set ts=2: -# vim:set et: -# vim:set shiftwidth=2: