summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-06-01 21:31:49 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-06-03 07:31:17 +1000
commit42247f0f5d08bce4d3fd2b020b770a12cc2f91db (patch)
tree735520042eb42153965b16f5aceb0aa4ae6ec398
parentd7be0333ae1fc03bb5b639e7ab8f5431b56d1071 (diff)
downloadpuppet-42247f0f5d08bce4d3fd2b020b770a12cc2f91db.tar.gz
puppet-42247f0f5d08bce4d3fd2b020b770a12cc2f91db.tar.xz
puppet-42247f0f5d08bce4d3fd2b020b770a12cc2f91db.zip
Fixing #2315 - ca --generate works again
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r--lib/puppet/indirector/key/ca.rb10
-rwxr-xr-xspec/unit/indirector/key/ca.rb16
2 files changed, 6 insertions, 20 deletions
diff --git a/lib/puppet/indirector/key/ca.rb b/lib/puppet/indirector/key/ca.rb
index 3604de22b..62dd77589 100644
--- a/lib/puppet/indirector/key/ca.rb
+++ b/lib/puppet/indirector/key/ca.rb
@@ -6,15 +6,7 @@ class Puppet::SSL::Key::Ca < Puppet::Indirector::SslFile
with the CA key, because that's the only key that the CA ever interacts
with."
- # This is just to pass the validation in the base class. Eh.
- store_at :cakey
+ store_in :privatekeydir
store_ca_at :cakey
-
- def path(name)
- unless ca?(name)
- raise ArgumentError, "The :ca terminus can only handle the CA private key"
- end
- super
- end
end
diff --git a/spec/unit/indirector/key/ca.rb b/spec/unit/indirector/key/ca.rb
index 579617f71..964b0b0ed 100755
--- a/spec/unit/indirector/key/ca.rb
+++ b/spec/unit/indirector/key/ca.rb
@@ -12,6 +12,11 @@ describe Puppet::SSL::Key::Ca do
Puppet::SSL::Key::Ca.doc.should be_instance_of(String)
end
+ it "should use the :privatekeydir as the collection directory" do
+ Puppet.settings.expects(:value).with(:privatekeydir).returns "/key/dir"
+ Puppet::SSL::Key::Ca.collection_directory.should == "/key/dir"
+ end
+
it "should store the ca key at the :cakey location" do
Puppet.settings.stubs(:use)
Puppet.settings.stubs(:value).returns "whatever"
@@ -20,15 +25,4 @@ describe Puppet::SSL::Key::Ca do
file.stubs(:ca?).returns true
file.path("whatever").should == "/ca/key"
end
-
- describe "when choosing the path for the public key" do
- it "should fail if the key is not for the CA" do
- Puppet.settings.stubs(:use)
- Puppet.settings.stubs(:value).returns "whatever"
- Puppet.settings.stubs(:value).with(:cakey).returns "/ca/key"
- file = Puppet::SSL::Key::Ca.new
- file.stubs(:ca?).returns false
- lambda { file.path("whatever") }.should raise_error(ArgumentError)
- end
- end
end