Simplify construction of the "renew" case

This commit is contained in:
Peter Eckersley
2015-12-12 10:25:36 -08:00
parent 621bef35c9
commit 6351194fc2
+1 -7
View File
@@ -235,7 +235,6 @@ def _treat_as_renewal(config, domains):
# flag).
#
# TODO: Also address superset case
renewal = False
# Considering the possibility that the requested certificate is
# related to an existing certificate. (config.duplicate, which
@@ -249,8 +248,6 @@ def _treat_as_renewal(config, domains):
question = None
if ident_names_cert is not None:
return _handle_identical_cert_request(ident_names_cert)
# TODO: Since the rest of the function deals only with the subset
# case, we could now simplify it considerably!
elif subset_names_cert is not None:
question = (
"You have an existing certificate that contains a portion of "
@@ -268,7 +265,7 @@ def _treat_as_renewal(config, domains):
pass
elif config.renew_by_default or zope.component.getUtility(
interfaces.IDisplay).yesno(question, "Replace", "Cancel"):
renewal = True
return "renew", subset_names_cert
else:
reporter_util = zope.component.getUtility(interfaces.IReporter)
reporter_util.add_message(
@@ -285,9 +282,6 @@ def _treat_as_renewal(config, domains):
"User did not use proper CLI and would like "
"to reinvoke the client.")
if renewal:
return "renew", ident_names_cert if ident_names_cert is not None else subset_names_cert
return "newcert", None
def _handle_identical_cert_request(cert):