projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Way more painful than is legal
[mirror/dsa-puppet.git]
/
modules
/
puppetmaster
/
lib
/
puppet
/
parser
/
functions
/
whohosts.rb
diff --git
a/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb
b/modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb
index
d032184
..
84b618c
100644
(file)
--- a/
modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb
+++ b/
modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb
@@
-17,7
+17,7
@@
module Puppet::Parser::Functions
yaml.keys.each do |hoster|
if yaml[hoster].kind_of?(Array)
netrange = yaml[hoster]
yaml.keys.each do |hoster|
if yaml[hoster].kind_of?(Array)
netrange = yaml[hoster]
- elsif yaml[hoster].kind_of?(
Array) and yaml[hoster].has_key?['netrange']
+ elsif yaml[hoster].kind_of?(
Hash) and yaml[hoster].has_key?('netrange')
netrange = yaml[hoster]['netrange']
else
next
netrange = yaml[hoster]['netrange']
else
next
@@
-25,10
+25,10
@@
module Puppet::Parser::Functions
netrange.each do |net|
begin
if IPAddr.new(net).include?(addr)
netrange.each do |net|
begin
if IPAddr.new(net).include?(addr)
-
return
hoster
+
ans =
hoster
end
end
- rescue
- raise "
Could not match addr #{addr} for net #{net
}"
+ rescue
Exception => e
+ raise "
Error while trying to match addr #{addr} for net #{net}: #{e.message}\n#{e.backtrace
}"
end
end
end
end
end
end