summaryrefslogtreecommitdiffstats
path: root/lib/puppet/sslcertificates
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-12-19 11:42:22 -0600
committerLuke Kanies <luke@madstop.com>2007-12-19 11:42:22 -0600
commit553b2ad8add20cd629fcd90b512d97d4edd7e481 (patch)
tree23acf8bf35ad697565647dac9c387d843552ba58 /lib/puppet/sslcertificates
parent5252f02dba8ef35db77ecb2d9bf711c1fd0b0bb2 (diff)
downloadpuppet-553b2ad8add20cd629fcd90b512d97d4edd7e481.tar.gz
puppet-553b2ad8add20cd629fcd90b512d97d4edd7e481.tar.xz
puppet-553b2ad8add20cd629fcd90b512d97d4edd7e481.zip
Entirely refactoring http keep-alive. There's now
a central module responsible for managing the http pool (Puppet::Network::HttpPool), and it also handles setting certificate information. This gets rid of what were otherwise long chains of method calls, and it makes the code paths much clearer.
Diffstat (limited to 'lib/puppet/sslcertificates')
-rw-r--r--lib/puppet/sslcertificates/support.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/puppet/sslcertificates/support.rb b/lib/puppet/sslcertificates/support.rb
index e63458b33..1d692c994 100644
--- a/lib/puppet/sslcertificates/support.rb
+++ b/lib/puppet/sslcertificates/support.rb
@@ -30,25 +30,23 @@ module Puppet::SSLCertificates::Support
define_method(reader) do
return nil unless FileTest.exists?(Puppet[param])
begin
- instance_variable_set(var,
- klass.new(File.read(Puppet[param])))
+ instance_variable_set(var, klass.new(File.read(Puppet[param])))
rescue => detail
- raise InvalidCertificate, "Could not read %s: %s" %
- [param, detail]
+ raise InvalidCertificate, "Could not read %s: %s" % [param, detail]
end
end
# Define the overall method, which just calls the reader and maker
# as appropriate.
define_method(name) do
- unless instance_variable_get(var)
+ unless cert = instance_variable_get(var)
unless cert = send(reader)
cert = send(maker)
Puppet.settings.write(param) { |f| f.puts cert.to_pem }
end
instance_variable_set(var, cert)
end
- instance_variable_get(var)
+ cert
end
end