projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make this explode
[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
20f83d3
..
b55204a
100644
(file)
--- a/
modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb
+++ b/
modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb
@@
-5,6
+5,7
@@
module Puppet::Parser::Functions
ipAddrs = args[0]
yamlfile = args[1]
ipAddrs = args[0]
yamlfile = args[1]
+ parser = Puppet::Parser::Parser.new(environment)
parser.watch_file(yamlfile)
$KCODE = 'utf-8'
parser.watch_file(yamlfile)
$KCODE = 'utf-8'
@@
-14,11
+15,8
@@
module Puppet::Parser::Functions
ipAddrs.each do |addr|
yaml.keys.each do |hoster|
ipAddrs.each do |addr|
yaml.keys.each do |hoster|
- if yaml[hoster].kind_of?(Hash) and yaml[hoster].has_key?('netrange')
- netrange = yaml[hoster]['netrange']
- else
- next
- end
+ next unless yaml[hoster].kind_of?(Hash) and yaml[hoster].has_key?('netrange')
+ netrange = yaml[hoster]['netrange']
netrange.each do |net|
begin
netrange.each do |net|
begin
@@
-32,6
+30,9
@@
module Puppet::Parser::Functions
end
end
end
end
end
end
+ if not ans['longname']
+ ans['longname'] = ans['name']
+ end
return ans
end
end
return ans
end
end