diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-12 20:04:25 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-12 20:04:25 +0000 |
| commit | a6122e8d67ffc0165e8746150e6af7f53cb7be2d (patch) | |
| tree | 9170d8be932d5d23085b1f10547a7de43159f960 /lib/puppet/parser | |
| parent | 360a40567479b8c50c5123cddf643e931c2665cc (diff) | |
| download | puppet-a6122e8d67ffc0165e8746150e6af7f53cb7be2d.tar.gz puppet-a6122e8d67ffc0165e8746150e6af7f53cb7be2d.tar.xz puppet-a6122e8d67ffc0165e8746150e6af7f53cb7be2d.zip | |
Fixing ldap node lookup. The test was set up badly, in that it did not actually provide a way to enable ldap node support, even though there was a config option that should have worked. All works now.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1254 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/interpreter.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 8a6018b58..9c74934b0 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -65,7 +65,11 @@ module Puppet @usenodes = true end - @nodesources = hash[:NodeSources] || [:file] + @nodesources = [:file] + + if Puppet[:ldapnodes] + @nodesources << :ldap + end @nodesources.each { |source| method = "setup_%s" % source.to_s @@ -129,7 +133,7 @@ module Puppet parent, nodeclasses = self.send(method, node) end - if nodeclasses + if nodeclasses and !nodeclasses.empty? Puppet.info "Found %s in %s" % [node, source] return parent, nodeclasses end @@ -145,6 +149,10 @@ module Puppet ldapconnect() end + if node =~ /\./ + node = node.sub(/\..+/, '') + end + filter = Puppet[:ldapstring] attrs = Puppet[:ldapattrs].split("\s*,\s*") sattrs = attrs.dup @@ -183,7 +191,7 @@ module Puppet attrs.each { |attr| if values = entry.vals(attr) - classes += values + values.each do |v| classes << v end end } end |
