summaryrefslogtreecommitdiffstats
path: root/lib/puppet/ssl
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-11-30 12:06:52 -0800
committerPaul Berry <paul@puppetlabs.com>2010-11-30 14:39:39 -0800
commit0747b58bfef9c6bb5f1f9ac1eb6a7b3955dac2af (patch)
tree2d7273c61a3aa21d4e475f63952450a0376a6b86 /lib/puppet/ssl
parentf77764de3ace7cc880a77466618a5affe1b61a8e (diff)
downloadpuppet-0747b58bfef9c6bb5f1f9ac1eb6a7b3955dac2af.tar.gz
puppet-0747b58bfef9c6bb5f1f9ac1eb6a7b3955dac2af.tar.xz
puppet-0747b58bfef9c6bb5f1f9ac1eb6a7b3955dac2af.zip
Maint: Modified uses of indirector.save to call the indirection directly.
This change replaces calls to <model object>.save with calls to <model class>.indirection.save(<model object>). This makes the use of the indirector explicit rather than implicit so that it will be easier to search for all indirector call sites using grep. This is an intermediate refactor on the way towards allowing indirector calls to be explicitly routed to multiple termini. This patch affects production code.
Diffstat (limited to 'lib/puppet/ssl')
-rw-r--r--lib/puppet/ssl/certificate_authority.rb4
-rw-r--r--lib/puppet/ssl/certificate_revocation_list.rb2
-rw-r--r--lib/puppet/ssl/host.rb4
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/ssl/certificate_authority.rb b/lib/puppet/ssl/certificate_authority.rb
index 5725be4d5..d65067c70 100644
--- a/lib/puppet/ssl/certificate_authority.rb
+++ b/lib/puppet/ssl/certificate_authority.rb
@@ -96,7 +96,7 @@ class Puppet::SSL::CertificateAuthority
unless @crl = Puppet::SSL::CertificateRevocationList.indirection.find(Puppet::SSL::CA_NAME)
@crl = Puppet::SSL::CertificateRevocationList.new(Puppet::SSL::CA_NAME)
@crl.generate(host.certificate.content, host.key.content)
- @crl.save
+ Puppet::SSL::CertificateRevocationList.indirection.save(@crl)
end
end
@crl
@@ -248,7 +248,7 @@ class Puppet::SSL::CertificateAuthority
# Save the now-signed cert. This should get routed correctly depending
# on the certificate type.
- cert.save
+ Puppet::SSL::Certificate.indirection.save(cert)
# And remove the CSR if this wasn't self signed.
Puppet::SSL::CertificateRequest.indirection.destroy(csr.name) unless self_signing_csr
diff --git a/lib/puppet/ssl/certificate_revocation_list.rb b/lib/puppet/ssl/certificate_revocation_list.rb
index 44e0a9e22..293f4b8c0 100644
--- a/lib/puppet/ssl/certificate_revocation_list.rb
+++ b/lib/puppet/ssl/certificate_revocation_list.rb
@@ -79,6 +79,6 @@ class Puppet::SSL::CertificateRevocationList < Puppet::SSL::Base
@content.sign(cakey, OpenSSL::Digest::SHA1.new)
- save
+ Puppet::SSL::CertificateRevocationList.indirection.save(self)
end
end
diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb
index 6539b057e..7f71ced99 100644
--- a/lib/puppet/ssl/host.rb
+++ b/lib/puppet/ssl/host.rb
@@ -126,7 +126,7 @@ class Puppet::SSL::Host
@key = Key.new(name)
@key.generate
begin
- @key.save
+ Key.indirection.save(@key)
rescue
@key = nil
raise
@@ -144,7 +144,7 @@ class Puppet::SSL::Host
@certificate_request = CertificateRequest.new(name)
@certificate_request.generate(key.content)
begin
- @certificate_request.save
+ CertificateRequest.indirection.save(@certificate_request)
rescue
@certificate_request = nil
raise