summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-07-17 14:00:29 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-07-17 14:00:29 +0000
commite61806566f8fff0bf7ef9b7e8c1d3ddec3dc88f8 (patch)
treef8947514d811aa83bde0a5e0df5441bd77b48ae5
parent49d8ef28083f08d859e86cdb3502806ee017bae5 (diff)
downloadpuppet-e61806566f8fff0bf7ef9b7e8c1d3ddec3dc88f8.tar.gz
puppet-e61806566f8fff0bf7ef9b7e8c1d3ddec3dc88f8.tar.xz
puppet-e61806566f8fff0bf7ef9b7e8c1d3ddec3dc88f8.zip
Applying a slightly modified patch by Dean Wilson -- puppetca now exits with a non-zero code when it cannot find certs to clean.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2702 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--CHANGELOG4
-rwxr-xr-xbin/puppetca10
2 files changed, 14 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 8bcacc27c..a8de66598 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+ puppetca now exits with a non-zero code if it cannot
+ find any host certificates to clean. (Patch by Dean
+ Wilson.)
+
Fully-qualified resources can now have defaults. (#589)
Resource references can now be fully-qualified names,
diff --git a/bin/puppetca b/bin/puppetca
index 2906fe91a..3dbd87b89 100755
--- a/bin/puppetca
+++ b/bin/puppetca
@@ -195,8 +195,18 @@ when :clean
$stderr.puts "You must specify one or more hosts to clean"
exit(24)
end
+ cleaned = false
hosts.each do |host|
+ cert = ca.getclientcert(host)[0]
+ if cert.nil?
+ $stderr.puts "Could not find client certificate for %s" % host
+ next
+ end
ca.clean(host)
+ cleaned = true
+ end
+ unless cleaned
+ exit(27)
end
when :sign
unless to_sign.length > 0 or all