projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Slightly modify ldapinfo, let's see what blows up
[mirror/dsa-puppet.git]
/
files
/
etc
/
puppet
/
lib
/
puppet
/
parser
/
functions
/
ldapinfo.rb
diff --git
a/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb
b/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb
index
23243c0
..
3a68722
100644
(file)
--- a/
files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb
+++ b/
files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb
@@
-7,6
+7,7
@@
module Puppet::Parser::Functions
attributes << 'hostname'
end
attributes << 'hostname'
end
+ require 'ldap'
ldap = LDAP::SSLConn.new('db.debian.org', 636)
results = {}
ldap = LDAP::SSLConn.new('db.debian.org', 636)
results = {}
@@
-18,7
+19,7
@@
module Puppet::Parser::Functions
unless attributes.include?("*")
next if attributes.any?{ |a| not x[a] or x[a].empty? }
end
unless attributes.include?("*")
next if attributes.any?{ |a| not x[a] or x[a].empty? }
end
- results[x['hostname']] = x
+ results[x['hostname']
[0]
] = x
end
rescue LDAP::ResultError
raise Puppet::ParseError, "LDAP error"
end
rescue LDAP::ResultError
raise Puppet::ParseError, "LDAP error"
@@
-27,6
+28,10
@@
module Puppet::Parser::Functions
ensure
ldap.unbind
end
ensure
ldap.unbind
end
- return( host == '*' ? results : results[host] )
+ if host == '*'
+ return(results)
+ else
+ return(results[host])
+ end
end
end
end
end