diff options
author | Luke Kanies <luke@madstop.com> | 2008-05-06 19:02:45 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-05-06 19:02:45 -0500 |
commit | dd4d8684fc19adcb68c681ba1c446a737498cda0 (patch) | |
tree | 7dfd898ef167982ea905a542fed6066fb78768b7 /lib/puppet | |
parent | 57c753419ac4700ab87689a3e3c3eb7302fff693 (diff) | |
download | puppet-dd4d8684fc19adcb68c681ba1c446a737498cda0.tar.gz puppet-dd4d8684fc19adcb68c681ba1c446a737498cda0.tar.xz puppet-dd4d8684fc19adcb68c681ba1c446a737498cda0.zip |
Fixing the HttpPool module to get rid of an infinite loop.
We can't have the HttpPool class use the Indirector to see
if it has a cert available, because it might be being used to
try to download one, which would cause it to make an http instance,
which would cause it to... Well, you get the idea.
Adding and fixing a few other tests I ran into on the way.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/network/client/ca.rb | 2 | ||||
-rw-r--r-- | lib/puppet/network/http_pool.rb | 2 | ||||
-rw-r--r-- | lib/puppet/network/xmlrpc/client.rb | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/network/client/ca.rb b/lib/puppet/network/client/ca.rb index a2704e451..5fbdfe9e3 100644 --- a/lib/puppet/network/client/ca.rb +++ b/lib/puppet/network/client/ca.rb @@ -45,7 +45,7 @@ class Puppet::Network::Client::CA < Puppet::Network::Client end unless @cert.check_private_key(key) - raise InvalidCertificate, "Certificate does not match private key. Try 'puppetca --clean %s' on the server." % Facter.value(:fqdn) + raise InvalidCertificate, "Certificate does not match private key. Try 'puppetca --clean %s' on the server." % Puppet[:certname] end # Only write the cert out if it passes validating. diff --git a/lib/puppet/network/http_pool.rb b/lib/puppet/network/http_pool.rb index 9dd4a576a..24cbee656 100644 --- a/lib/puppet/network/http_pool.rb +++ b/lib/puppet/network/http_pool.rb @@ -50,7 +50,7 @@ module Puppet::Network::HttpPool # Use cert information from a Puppet client to set up the http object. def self.cert_setup(http) # Just no-op if we don't have certs. - return false unless ssl_host.certificate + return false unless FileTest.exist?(Puppet[:hostcert]) # ssl_host.certificate http.cert_store = ssl_host.ssl_store http.ca_file = Puppet[:localcacert] diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb index e0fb5a0ab..dfd4a95a7 100644 --- a/lib/puppet/network/xmlrpc/client.rb +++ b/lib/puppet/network/xmlrpc/client.rb @@ -51,7 +51,8 @@ module Puppet::Network end ["certificate verify failed", "hostname was not match", "hostname not match"].each do |str| if detail.message.include?(str) - Puppet.warning "Certificate validation failed; considering using the certname configuration option" + Puppet.warning "Certificate validation failed; consider using the certname configuration option" + break end end raise XMLRPCClientError, |