Sometimes this ruby puppet thing is weird
[mirror/dsa-puppet.git] / files / etc / puppet / lib / puppet / parser / functions / allnodeinfo.rb
index c86ce4f..47450d5 100644 (file)
@@ -1,23 +1,6 @@
 module Puppet::Parser::Functions
   newfunction(:allnodeinfo, :type => :rvalue) do |attributes|
-
-    unless attributes.include?('hostname')
-      attributes << 'hostname'
-    end
-
-    ldap = LDAP::Conn.new('db.debian.org')
-
-    results = []
-    filter = '(hostname=*)'
-    begin
-      ldap.search2('ou=hosts,dc=debian,dc=org', LDAP::LDAP_SCOPE_SUBTREE, filter, attrs=attributes, false, 0, 0, s_attr="hostname") do |x|
-        results << x
-      end
-    rescue LDAP::ResultError
-    rescue RuntimeError
-    ensure
-      ldap.unbind
-    end
-    return(results)
+    attributes.unshift('*')
+    return (function_ldapinfo(attributes))
   end
 end