summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-04-16 14:21:31 -0500
committerLuke Kanies <luke@madstop.com>2008-04-16 14:21:31 -0500
commit7d2c05e86eb14bc7600dcf1d61ba447cd9b4cab8 (patch)
treeaf309350a1132acdc2be810bc2a5ea3ac4628a77
parent7555af6de90a42bc7ff12381b3c198335c651299 (diff)
downloadpuppet-7d2c05e86eb14bc7600dcf1d61ba447cd9b4cab8.tar.gz
puppet-7d2c05e86eb14bc7600dcf1d61ba447cd9b4cab8.tar.xz
puppet-7d2c05e86eb14bc7600dcf1d61ba447cd9b4cab8.zip
The 'destroy' method for the ssl_file terminus base class
now returns false on missing files, rather than failing.
-rw-r--r--lib/puppet/indirector/ssl_file.rb2
-rwxr-xr-xspec/unit/indirector/ssl_file.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/indirector/ssl_file.rb b/lib/puppet/indirector/ssl_file.rb
index c66d71e91..eddf82ac5 100644
--- a/lib/puppet/indirector/ssl_file.rb
+++ b/lib/puppet/indirector/ssl_file.rb
@@ -27,7 +27,7 @@ class Puppet::Indirector::SslFile < Puppet::Indirector::Terminus
# Remove our file.
def destroy(request)
path = path(request.key)
- raise Puppet::Error.new("File %s does not exist; cannot destroy" % [request.key]) unless FileTest.exist?(path)
+ return false unless FileTest.exist?(path)
begin
File.unlink(path)
diff --git a/spec/unit/indirector/ssl_file.rb b/spec/unit/indirector/ssl_file.rb
index 31f82856e..2671f964f 100755
--- a/spec/unit/indirector/ssl_file.rb
+++ b/spec/unit/indirector/ssl_file.rb
@@ -111,8 +111,8 @@ describe Puppet::Indirector::SslFile do
FileTest.expects(:exist?).with(@certpath).returns false
end
- it "should fail" do
- lambda { @searcher.destroy(@request) }.should raise_error(Puppet::Error)
+ it "should return nil" do
+ @searcher.destroy(@request).should be_false
end
end