Commit 12efc3ca authored by Patrick J Cherry's avatar Patrick J Cherry
Browse files

common: Rejigged exception handling when doing SSL magic

Pared down the exceptions caught to EEXIST and ENOTDIR when retrying a
write.  I think erring on the conservative side here (rather than
catching StandardError) is best.

Also there's no infinite retry loop now.
parent 764ebd54
...@@ -419,12 +419,15 @@ module Symbiosis ...@@ -419,12 +419,15 @@ module Symbiosis
raise RuntimeError, "Failed to fetch certificate" if cert_set.nil? raise RuntimeError, "Failed to fetch certificate" if cert_set.nil?
cert_set.name = self.ssl_next_set_name cert_set.name = self.ssl_next_set_name
retried = false
begin begin
cert_set.write cert_set.write
rescue StandardError rescue Errno::ENOTDIR, Errno::EEXIST
cert_set.name = cert_set.name.succ! cert_set.name = cert_set.name.succ!
cert_set.directory = cert_set.name cert_set.directory = cert_set.name
retry retried = true
retry unless retried
end end
@ssl_available_sets << cert_set @ssl_available_sets << cert_set
...@@ -440,11 +443,6 @@ module Symbiosis ...@@ -440,11 +443,6 @@ module Symbiosis
return !do_rollover return !do_rollover
end end
# rescue StandardError => err
# puts "\t!! Failed: #{err.to_s.gsub($/,'')}" if $VERBOSE
# puts err.backtrace.join("\n") if $DEBUG
# return false
end end
end end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment