diff options
| author | Luke Kanies <luke@madstop.com> | 2008-05-05 22:36:59 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-05-05 22:36:59 -0500 |
| commit | 38e2dcf35a1d9b19970d1fb253f6c09b0529e083 (patch) | |
| tree | d4e28bf2ebc43b73bfd36bfb72bf5b5da53e6ee7 | |
| parent | 6e0d6ddf5ef1cd6b23a672020bb657744b5a2c59 (diff) | |
| download | puppet-38e2dcf35a1d9b19970d1fb253f6c09b0529e083.tar.gz puppet-38e2dcf35a1d9b19970d1fb253f6c09b0529e083.tar.xz puppet-38e2dcf35a1d9b19970d1fb253f6c09b0529e083.zip | |
The master is now functionally serving REST and xmlrpc.
...as far as I can tell. The client, however, is broken,
since it used the old http_pool/ssl_support stuff, which
no longer works.
I have to port puppetd over to using the new ssl stuff,
then I'll at least be able to verify that the master can
still speak xmlrpc.
| -rwxr-xr-x | bin/puppetmasterd | 6 | ||||
| -rw-r--r-- | lib/puppet/network/http/webrick.rb | 2 | ||||
| -rw-r--r-- | spec/unit/network/http/webrick.rb | 12 |
3 files changed, 9 insertions, 11 deletions
diff --git a/bin/puppetmasterd b/bin/puppetmasterd index 11b0d7fd0..57fc4bdb4 100755 --- a/bin/puppetmasterd +++ b/bin/puppetmasterd @@ -176,9 +176,13 @@ require 'puppet/file_serving/content' require 'puppet/file_serving/metadata' require 'puppet/checksum' -xmlrpc_handlers = [:Status, :FileServer, :Master, :Report, :CA, :Filebucket] +xmlrpc_handlers = [:Status, :FileServer, :Master, :Report, :Filebucket] rest_handlers = [:file_content, :file_metadata, :certificate, :facts, :catalog, :report, :checksum] +if Puppet[:ca] + xmlrpc_handlers << :CA +end + server = Puppet::Network::Server.new(:handlers => rest_handlers, :xmlrpc_handlers => xmlrpc_handlers) if Process.uid == 0 diff --git a/lib/puppet/network/http/webrick.rb b/lib/puppet/network/http/webrick.rb index 30085ec47..3e7a28598 100644 --- a/lib/puppet/network/http/webrick.rb +++ b/lib/puppet/network/http/webrick.rb @@ -91,7 +91,7 @@ class Puppet::Network::HTTP::WEBrick host = Puppet::SSL::Host.new - host.generate unless host.key + host.generate unless host.certificate raise Puppet::Error, "Could not retrieve certificate for %s and not running on a valid certificate authority" % host.name unless host.certificate diff --git a/spec/unit/network/http/webrick.rb b/spec/unit/network/http/webrick.rb index 6bd3c2785..58b0d9a3d 100644 --- a/spec/unit/network/http/webrick.rb +++ b/spec/unit/network/http/webrick.rb @@ -303,25 +303,19 @@ describe Puppet::Network::HTTP::WEBrick do it "should use the key from an SSL::Host instance created with the default name" do Puppet::SSL::Host.expects(:new).returns @host - @host.expects(:key).returns "mykey" + @host.expects(:key).returns @key @server.setup_ssl[:SSLPrivateKey].should == "mykey" end - it "should generate a key if no key can be found" do - @host.expects(:key).times(2).returns(nil).then.returns(@key) + it "should generate its files if no certificate can be found" do + @host.expects(:certificate).times(2).returns(nil).then.returns(@cert) @host.expects(:generate) @server.setup_ssl end - it "should fail if no certificate can be found" do - @host.expects(:certificate).returns nil - - lambda { @server.setup_ssl }.should raise_error(Puppet::Error) - end - it "should configure the certificate" do @server.setup_ssl[:SSLCertificate].should == "mycert" end |
