diff options
| author | Luke Kanies <luke@madstop.com> | 2008-11-03 21:39:13 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-11-03 21:39:13 -0600 |
| commit | a78c971829959d9d4b89aa841249fc973b8972b2 (patch) | |
| tree | 6d10ffe666413337b101fa5fef89e0fc7bf90d1f | |
| parent | e70c1a067a801443719bfabb26aa0a2690b02838 (diff) | |
Fixing CertificateRequest#save to accept arguments.
This happens when called over REST.
Signed-off-by: Luke Kanies <luke@madstop.com>
| -rw-r--r-- | lib/puppet/ssl/certificate_request.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/ssl/certificate_request.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/puppet/ssl/certificate_request.rb b/lib/puppet/ssl/certificate_request.rb index e345f4bb6..6a0464a33 100644 --- a/lib/puppet/ssl/certificate_request.rb +++ b/lib/puppet/ssl/certificate_request.rb @@ -40,7 +40,7 @@ class Puppet::SSL::CertificateRequest < Puppet::SSL::Base @content = csr end - def save + def save(args = {}) super() # Try to autosign the CSR. diff --git a/spec/unit/ssl/certificate_request.rb b/spec/unit/ssl/certificate_request.rb index aa6bba625..3f25500c0 100755 --- a/spec/unit/ssl/certificate_request.rb +++ b/spec/unit/ssl/certificate_request.rb @@ -163,6 +163,13 @@ describe Puppet::SSL::CertificateRequest do end describe "when a CSR is saved" do + it "should allow arguments" do + csr = Puppet::SSL::CertificateRequest.new("me") + csr.class.indirection.stubs(:save) + + lambda { csr.save :ipaddress => "foo" }.should_not raise_error + end + describe "and a CA is available" do it "should save the CSR and trigger autosigning" do ca = mock 'ca', :autosign |
