summaryrefslogtreecommitdiffstats
path: root/lib/puppet/indirector/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-04-08 21:21:59 -0500
committerLuke Kanies <luke@madstop.com>2008-04-08 21:21:59 -0500
commit7774d9c443f19d44a1e2dab459fc4bfb94e75244 (patch)
tree78287fb85c8a1a5b70617a9e153dcca311dea15d /lib/puppet/indirector/node
parentbf728d23caca4f58ae4ede1a2d477c9fc15e0bdc (diff)
downloadpuppet-7774d9c443f19d44a1e2dab459fc4bfb94e75244.tar.gz
puppet-7774d9c443f19d44a1e2dab459fc4bfb94e75244.tar.xz
puppet-7774d9c443f19d44a1e2dab459fc4bfb94e75244.zip
Ported the rest of the indirection terminuses over to
expecting requests instead of having a random interface.
Diffstat (limited to 'lib/puppet/indirector/node')
-rw-r--r--lib/puppet/indirector/node/exec.rb13
-rw-r--r--lib/puppet/indirector/node/ldap.rb9
-rw-r--r--lib/puppet/indirector/node/plain.rb9
3 files changed, 8 insertions, 23 deletions
diff --git a/lib/puppet/indirector/node/exec.rb b/lib/puppet/indirector/node/exec.rb
index dcfc625b2..52cbc370c 100644
--- a/lib/puppet/indirector/node/exec.rb
+++ b/lib/puppet/indirector/node/exec.rb
@@ -15,20 +15,13 @@ class Puppet::Node::Exec < Puppet::Indirector::Exec
end
# Look for external node definitions.
- def find(name)
+ def find(request)
output = super or return nil
# Translate the output to ruby.
- result = translate(name, output)
+ result = translate(request.key, output)
- return create_node(name, result)
- end
-
- # Use the version of the facts, since we assume that's the main thing
- # that changes. If someone wants their own way of defining version,
- # they can easily provide their own, um, version of this class.
- def version(name)
- Puppet::Node::Facts.version(name)
+ return create_node(request.key, result)
end
private
diff --git a/lib/puppet/indirector/node/ldap.rb b/lib/puppet/indirector/node/ldap.rb
index 73b5cdd70..6c41c18d4 100644
--- a/lib/puppet/indirector/node/ldap.rb
+++ b/lib/puppet/indirector/node/ldap.rb
@@ -12,8 +12,11 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
end
# Look for our node in ldap.
- def find(name)
+ def find(request)
return nil unless information = super
+
+ name = request.key
+
node = Puppet::Node.new(name)
parent_info = nil
@@ -123,8 +126,4 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
end
filter
end
-
- def version(name)
- Puppet::Node::Facts.version(name)
- end
end
diff --git a/lib/puppet/indirector/node/plain.rb b/lib/puppet/indirector/node/plain.rb
index 8058563e6..37ceb064d 100644
--- a/lib/puppet/indirector/node/plain.rb
+++ b/lib/puppet/indirector/node/plain.rb
@@ -11,16 +11,9 @@ class Puppet::Node::Plain < Puppet::Indirector::Plain
node instance before it is returned."
# Just return an empty node.
- def find(name)
+ def find(request)
node = super
node.fact_merge
node
end
-
- # Use the version of the facts, since we assume that's the main thing
- # that changes. If someone wants their own way of defining version,
- # they can easily provide their own, um, version of this class.
- def version(name)
- Puppet::Node::Facts.version(name)
- end
end