]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/puppetmaster/lib/puppet/parser/functions/whohosts.rb
variable assignment does not clone string...
[dsa-puppet.git] / modules / puppetmaster / lib / puppet / parser / functions / whohosts.rb
index f98bf0ad050cd2c33a0857d2a29f3c7698ed0454..ca0d2957c7ec51e0f52ffbce4ca8473cc499184b 100644 (file)
@@ -5,9 +5,8 @@ module Puppet::Parser::Functions
 
     ipAddrs = args[0]
     yamlfile = args[1]
-    #self.interp.newfile(yamlfile)
-
-    $KCODE = 'utf-8'
+    parser = Puppet::Parser::Parser.new(environment)
+    parser.watch_file(yamlfile)
 
     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