summaryrefslogtreecommitdiffstats
path: root/lib
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
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')
-rw-r--r--lib/puppet/indirector/rest.rb11
-rw-r--r--lib/puppet/network/http/mongrel/rest.rb10
-rw-r--r--lib/puppet/network/http_pool.rb2
3 files changed, 10 insertions, 13 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)
diff --git a/lib/puppet/network/http/mongrel/rest.rb b/lib/puppet/network/http/mongrel/rest.rb
index 2a3d4f143..a471a62bf 100644
--- a/lib/puppet/network/http/mongrel/rest.rb
+++ b/lib/puppet/network/http/mongrel/rest.rb
@@ -2,12 +2,12 @@ require 'puppet/network/http/handler'
class Puppet::Network::HTTP::MongrelREST < Mongrel::HttpHandler
- include Puppet::Network::HTTP::Handler
+ include Puppet::Network::HTTP::Handler
- def initialize(args={})
- super()
- initialize_for_puppet(args)
- end
+ def initialize(args={})
+ super()
+ initialize_for_puppet(args)
+ end
private
diff --git a/lib/puppet/network/http_pool.rb b/lib/puppet/network/http_pool.rb
index 8c73adba6..9dd4a576a 100644
--- a/lib/puppet/network/http_pool.rb
+++ b/lib/puppet/network/http_pool.rb
@@ -23,8 +23,6 @@ module Puppet::Network::HttpPool
@ssl_host
end
- # This handles reading in the key and such-like.
- extend Puppet::SSLCertificates::Support
@http_cache = {}
# Clear our http cache, closing all connections.