From: Peter Palfrader Date: Tue, 1 Mar 2011 10:49:05 +0000 (+0100) Subject: Remove array support X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;ds=sidebyside;h=11a422dfc9e2ee37f0bd5d6ead76ea2de7b76d57;p=dsa-puppet.git Remove array support --- diff --git a/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb b/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb index 84b618c3..780afa1d 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb @@ -15,13 +15,12 @@ module Puppet::Parser::Functions if (nodeinfo['ldap'].has_key?('ipHostNumber')) nodeinfo['ldap']['ipHostNumber'].each do |addr| yaml.keys.each do |hoster| - if yaml[hoster].kind_of?(Array) - netrange = yaml[hoster] - elsif yaml[hoster].kind_of?(Hash) and yaml[hoster].has_key?('netrange') + if yaml[hoster].kind_of?(Hash) and yaml[hoster].has_key?('netrange') netrange = yaml[hoster]['netrange'] else next end + netrange.each do |net| begin if IPAddr.new(net).include?(addr)