~bkerensa/ubuntu/raring/puppet/new-upstream-release

« back to all changes in this revision

Viewing changes to lib/puppet/ssl/certificate_request.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-25 01:00:37 UTC
  • mfrom: (1.1.24 upstream) (3.1.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110725010037-875vuxs10eboqgw3
Tags: 2.7.1-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/puppetmaster-passenger.postinst: Use cacrl instead of hostcrl to
    set the location of the CRL in apache2 configuration. Fix apache2
    configuration on upgrade as well (LP: #641001)
  - move all puppet dependencies to puppet-common since all the code
    actually located in puppet-common.
  - move libagueas from a recommend to a dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
  wraps OpenSSL::X509::Request
6
6
 
7
7
  extend Puppet::Indirector
8
 
  indirects :certificate_request, :terminus_class => :file
 
8
 
 
9
  # If auto-signing is on, sign any certificate requests as they are saved.
 
10
  module AutoSigner
 
11
    def save(instance, key = nil)
 
12
      super
 
13
 
 
14
      # Try to autosign the CSR.
 
15
      if ca = Puppet::SSL::CertificateAuthority.instance
 
16
        ca.autosign
 
17
      end
 
18
    end
 
19
  end
 
20
 
 
21
  indirects :certificate_request, :terminus_class => :file, :extend => AutoSigner
9
22
 
10
23
  # Convert a string into an instance.
11
24
  def self.from_s(string)
46
59
    Puppet.info "Certificate Request fingerprint (md5): #{fingerprint}"
47
60
    @content
48
61
  end
49
 
 
50
 
  def save(args = {})
51
 
    super()
52
 
 
53
 
    # Try to autosign the CSR.
54
 
    if ca = Puppet::SSL::CertificateAuthority.instance
55
 
      ca.autosign
56
 
    end
57
 
  end
58
62
end