]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb
Give arrays another try
[dsa-puppet.git] / modules / puppetmaster / lib / puppet / parser / functions / whohosts.rb
index ed2a0c0436aac40151f28c7d8f8cc538017bd825..ca0d2957c7ec51e0f52ffbce4ca8473cc499184b 100644 (file)
@@ -5,10 +5,9 @@ module Puppet::Parser::Functions
 
     ipAddrs = args[0]
     yamlfile = args[1]
+    parser = Puppet::Parser::Parser.new(environment)
     parser.watch_file(yamlfile)
 
-    $KCODE = 'utf-8'
-
     ans = {"name" => "unknown"}
     yaml = YAML.load_file(yamlfile)
 
@@ -29,6 +28,9 @@ module Puppet::Parser::Functions
         end
       end
     end
+    if not ans['longname']
+      ans['longname'] = ans['name']
+    end
     return ans
   end
 end