summaryrefslogtreecommitdiffstats
path: root/lib/puppet/indirector/rest.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-05-05 22:25:42 -0500
committerLuke Kanies <luke@madstop.com>2008-05-05 22:25:42 -0500
commit6e0d6ddf5ef1cd6b23a672020bb657744b5a2c59 (patch)
tree472d2c2b9880e214ad0057954bb499446769827a /lib/puppet/indirector/rest.rb
parent51ce6746bc4c865b307af77b0967b345bf095aa8 (diff)
downloadpuppet-6e0d6ddf5ef1cd6b23a672020bb657744b5a2c59.tar.gz
puppet-6e0d6ddf5ef1cd6b23a672020bb657744b5a2c59.tar.xz
puppet-6e0d6ddf5ef1cd6b23a672020bb657744b5a2c59.zip
The REST infrastructure now correctly the SSL certificates.
I don't think the whole thing is done, but at least the basic flows are in place. Now it's just a question of doing real-world tests and fleshing out the unit tests as necessary.
Diffstat (limited to 'lib/puppet/indirector/rest.rb')
-rw-r--r--lib/puppet/indirector/rest.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/puppet/indirector/rest.rb b/lib/puppet/indirector/rest.rb
index d33150fc2..77dd0538b 100644
--- a/lib/puppet/indirector/rest.rb
+++ b/lib/puppet/indirector/rest.rb
@@ -3,21 +3,20 @@ require 'uri'
# Access objects via REST
class Puppet::Indirector::REST < Puppet::Indirector::Terminus
-
def rest_connection_details
{ :host => Puppet[:server], :port => Puppet[:masterport].to_i }
end
def network_fetch(path)
- network {|conn| conn.get("/#{path}").body }
+ network.get("/#{path}").body
end
def network_delete(path)
- network {|conn| conn.delete("/#{path}").body }
+ network.delete("/#{path}").body
end
def network_put(path, data)
- network {|conn| conn.put("/#{path}", data).body }
+ network.put("/#{path}", data).body
end
def find(request)
@@ -46,8 +45,8 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
private
- def network(&block)
- Net::HTTP.start(rest_connection_details[:host], rest_connection_details[:port]) {|conn| yield(conn) }
+ def network
+ Puppet::Network::HttpPool.http_instance(rest_connection_details[:host], rest_connection_details[:port])
end
def exception?(yaml_string)