diff options
| author | James Turnbull <james@lovedthanlost.net> | 2008-03-05 20:52:21 +1100 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2008-03-05 20:52:21 +1100 |
| commit | ba2dde2d94188af63836845cd6db1c37acecd5c4 (patch) | |
| tree | 70eb4abaa7afa894643e3ee549431adb12a13695 | |
| parent | 281448fb47a7c88bf8d1c3222d03264ecfaeb183 (diff) | |
| parent | 443db2009d0f5033eb51ebd210af2a198572fad0 (diff) | |
| download | puppet-ba2dde2d94188af63836845cd6db1c37acecd5c4.tar.gz puppet-ba2dde2d94188af63836845cd6db1c37acecd5c4.tar.xz puppet-ba2dde2d94188af63836845cd6db1c37acecd5c4.zip | |
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
| -rw-r--r-- | CHANGELOG | 1 | ||||
| -rw-r--r-- | conf/redhat/puppet.spec | 2 | ||||
| -rw-r--r-- | lib/puppet.rb | 2 | ||||
| -rwxr-xr-x | lib/puppet/network/handler/fileserver.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/network/http_pool.rb | 39 |
5 files changed, 18 insertions, 30 deletions
@@ -1,3 +1,4 @@ +0.24.2 Fixing #1062 by moving the yamldir setting to its own yaml section. This should keep the yamldir from being created on clients. diff --git a/conf/redhat/puppet.spec b/conf/redhat/puppet.spec index 9811e3492..bca690c3f 100644 --- a/conf/redhat/puppet.spec +++ b/conf/redhat/puppet.spec @@ -7,7 +7,7 @@ Summary: A network tool for managing many disparate systems Name: puppet -Version: 0.24.1 +Version: 0.24.2 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base diff --git a/lib/puppet.rb b/lib/puppet.rb index 57f84d5f7..a0cd1e726 100644 --- a/lib/puppet.rb +++ b/lib/puppet.rb @@ -25,7 +25,7 @@ require 'puppet/util/suidmanager' # it's also a place to find top-level commands like 'debug' module Puppet - PUPPETVERSION = '0.24.1' + PUPPETVERSION = '0.24.2' def Puppet.version return PUPPETVERSION diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index a9a95bcfe..751a77220 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -69,8 +69,8 @@ class Puppet::Network::Handler mount.debug("Describing %s for %s" % [url, client]) if client - # Remove any leading slashes, since Metadata doesn't like them, yo. - metadata = Puppet::FileServing::Metadata.new(url, :path => mount.path(client), :relative_path => path.sub(/^\//, ''), :links => links) + # use the mount to resolve the path for us. + metadata = Puppet::FileServing::Metadata.new(url, :path => mount.file_path(path, client), :links => links) return "" unless metadata.exist? diff --git a/spec/unit/network/http_pool.rb b/spec/unit/network/http_pool.rb index 503440274..3043c5e61 100755 --- a/spec/unit/network/http_pool.rb +++ b/spec/unit/network/http_pool.rb @@ -9,6 +9,9 @@ require 'puppet/network/http_pool' describe Puppet::Network::HttpPool, " when adding certificate information to http instances" do before do @http = mock 'http' + [:cert_store=, :verify_mode=, :ca_file=, :cert=, :key=].each { |m| @http.stubs(m) } + @store = stub 'store' + [:add_file,:purpose=].each { |m| @store.stubs(m) } end it "should do nothing if no certificate is available" do @@ -20,26 +23,18 @@ describe Puppet::Network::HttpPool, " when adding certificate information to htt it "should add a certificate store" do Puppet::Network::HttpPool.stubs(:read_cert).returns(true) Puppet::Network::HttpPool.stubs(:key).returns(:mykey) - store = stub "store" - OpenSSL::X509::Store.expects(:new).returns(store) - store.stubs(:add_file) - store.stubs(:purpose=) - [:verify_mode=, :ca_file=, :cert=, :key=].each { |method| @http.stubs(method) } - @http.expects(:cert_store=).with(store) + OpenSSL::X509::Store.expects(:new).returns(@store) + @http.expects(:cert_store=).with(@store) Puppet::Network::HttpPool.cert_setup(@http) end it "should add the local CA cert to the certificate store" do Puppet::Network::HttpPool.stubs(:read_cert).returns(true) - store = stub "store" - OpenSSL::X509::Store.expects(:new).returns(store) - store.stubs(:purpose=) - @http.stubs(:cert_store=) + OpenSSL::X509::Store.expects(:new).returns(@store) Puppet.settings.stubs(:value).with(:localcacert).returns("/some/file") Puppet.settings.stubs(:value).with(:localcacert).returns("/some/file") - store.expects(:add_file).with("/some/file") - [:store=, :verify_mode=, :ca_file=, :cert=, :key=].each { |method| @http.stubs(method) } + @store.expects(:add_file).with("/some/file") Puppet::Network::HttpPool.stubs(:key).returns(:whatever) @@ -49,12 +44,9 @@ describe Puppet::Network::HttpPool, " when adding certificate information to htt it "should set the purpose of the cert store to OpenSSL::X509::PURPOSE_SSL_CLIENT" do Puppet::Network::HttpPool.stubs(:read_cert).returns(true) Puppet::Network::HttpPool.stubs(:key).returns(:mykey) - store = stub "store" - OpenSSL::X509::Store.expects(:new).returns(store) - store.stubs(:add_file) - [:cert_store=, :verify_mode=, :ca_file=, :cert=, :key=].each { |method| @http.stubs(method) } + OpenSSL::X509::Store.expects(:new).returns(@store) - store.expects(:purpose=).with(OpenSSL::X509::PURPOSE_SSL_CLIENT) + @store.expects(:purpose=).with(OpenSSL::X509::PURPOSE_SSL_CLIENT) Puppet::Network::HttpPool.cert_setup(@http) end @@ -63,7 +55,7 @@ describe Puppet::Network::HttpPool, " when adding certificate information to htt Puppet::Network::HttpPool.stubs(:read_cert).returns(true) Puppet::Network::HttpPool.stubs(:cert).returns(:mycert) Puppet::Network::HttpPool.stubs(:key).returns(:mykey) - [:cert_store=, :verify_mode=, :ca_file=, :key=].each { |method| @http.stubs(method) } + OpenSSL::X509::Store.expects(:new).returns(@store) @http.expects(:cert=).with(:mycert) @@ -73,7 +65,7 @@ describe Puppet::Network::HttpPool, " when adding certificate information to htt it "should add the client key" do Puppet::Network::HttpPool.stubs(:read_cert).returns(true) Puppet::Network::HttpPool.stubs(:key).returns(:mykey) - [:cert_store=, :verify_mode=, :cert=, :ca_file=].each { |method| @http.stubs(method) } + OpenSSL::X509::Store.expects(:new).returns(@store) @http.expects(:key=).with(:mykey) @@ -83,7 +75,7 @@ describe Puppet::Network::HttpPool, " when adding certificate information to htt it "should set the verify mode to OpenSSL::SSL::VERIFY_PEER" do Puppet::Network::HttpPool.stubs(:read_cert).returns(true) Puppet::Network::HttpPool.stubs(:key).returns(:mykey) - [:key=, :cert=, :cert_store=, :ca_file=].each { |method| @http.stubs(method) } + OpenSSL::X509::Store.expects(:new).returns(@store) @http.expects(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER) @@ -93,12 +85,7 @@ describe Puppet::Network::HttpPool, " when adding certificate information to htt it "should set the ca file" do Puppet::Network::HttpPool.stubs(:read_cert).returns(true) Puppet.settings.stubs(:value).with(:localcacert).returns("/some/file") - [:key=, :cert=, :cert_store=, :verify_mode=].each { |method| @http.stubs(method) } - - store = stub "store" - OpenSSL::X509::Store.expects(:new).returns(store) - store.stubs(:purpose=) - store.stubs(:add_file) + OpenSSL::X509::Store.expects(:new).returns(@store) @http.expects(:ca_file=).with("/some/file") |
