mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 03:11:55 +02:00
Fix logic error if requesting nonduplicative cert
This commit is contained in:
+9
-2
@@ -216,12 +216,15 @@ def run(args, config, plugins): # pylint: disable=too-many-branches,too-many-lo
|
|||||||
treat_as_renewal = False
|
treat_as_renewal = False
|
||||||
|
|
||||||
# Considering the possibility that the requested certificate is
|
# Considering the possibility that the requested certificate is
|
||||||
# related to an existing certificate.
|
# related to an existing certificate. (config.duplicate, which
|
||||||
|
# is set with --duplicate, skips all of this logic and forces any
|
||||||
|
# kind of certificate to be obtained with treat_as_renewal = False.)
|
||||||
if not config.duplicate:
|
if not config.duplicate:
|
||||||
identical_names_cert, subset_names_cert = _find_duplicative_certs(
|
identical_names_cert, subset_names_cert = _find_duplicative_certs(
|
||||||
domains, config, configuration.RenewerConfiguration(config))
|
domains, config, configuration.RenewerConfiguration(config))
|
||||||
# I am not sure whether that correctly reads the systemwide
|
# I am not sure whether that correctly reads the systemwide
|
||||||
# configuration file.
|
# configuration file.
|
||||||
|
question = None
|
||||||
if identical_names_cert:
|
if identical_names_cert:
|
||||||
question = (
|
question = (
|
||||||
"You have an existing certificate that contains exactly the "
|
"You have an existing certificate that contains exactly the "
|
||||||
@@ -237,7 +240,11 @@ def run(args, config, plugins): # pylint: disable=too-many-branches,too-many-lo
|
|||||||
"certificate with the new certificate?"
|
"certificate with the new certificate?"
|
||||||
).format(subset_names_cert[0], ", ".join(subset_names_cert[2]),
|
).format(subset_names_cert[0], ", ".join(subset_names_cert[2]),
|
||||||
", ".join(domains))
|
", ".join(domains))
|
||||||
if zope.component.getUtility(interfaces.IDisplay).yesno(
|
if question is None:
|
||||||
|
# We aren't in a duplicative-names situation at all, so we don't
|
||||||
|
# have to tell or ask the user anything about this.
|
||||||
|
pass
|
||||||
|
elif zope.component.getUtility(interfaces.IDisplay).yesno(
|
||||||
question, "Replace", "Cancel"):
|
question, "Replace", "Cancel"):
|
||||||
treat_as_renewal = True
|
treat_as_renewal = True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user