mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 18:56:55 +02:00
Cleanup formatting issues
This commit is contained in:
+11
-5
@@ -225,7 +225,7 @@ def _treat_as_renewal(config, domains):
|
|||||||
"You have an existing certificate that contains exactly the "
|
"You have an existing certificate that contains exactly the "
|
||||||
"same domains you requested (ref: {0}){br}{br}Do you want to "
|
"same domains you requested (ref: {0}){br}{br}Do you want to "
|
||||||
"renew and replace this certificate with a newly-issued one?"
|
"renew and replace this certificate with a newly-issued one?"
|
||||||
).format(ident_names_cert.configfile.filename)
|
).format(ident_names_cert.configfile.filename, br=os.linesep)
|
||||||
elif subset_names_cert is not None:
|
elif subset_names_cert is not None:
|
||||||
question = (
|
question = (
|
||||||
"You have an existing certificate that contains a portion of "
|
"You have an existing certificate that contains a portion of "
|
||||||
@@ -235,7 +235,8 @@ def _treat_as_renewal(config, domains):
|
|||||||
"certificate with the new certificate?"
|
"certificate with the new certificate?"
|
||||||
).format(subset_names_cert.configfile.filename,
|
).format(subset_names_cert.configfile.filename,
|
||||||
", ".join(subset_names_cert.names()),
|
", ".join(subset_names_cert.names()),
|
||||||
", ".join(domains))
|
", ".join(domains),
|
||||||
|
br=os.linesep)
|
||||||
if question is None:
|
if question is None:
|
||||||
# We aren't in a duplicative-names situation at all, so we don't
|
# We aren't in a duplicative-names situation at all, so we don't
|
||||||
# have to tell or ask the user anything about this.
|
# have to tell or ask the user anything about this.
|
||||||
@@ -250,7 +251,10 @@ def _treat_as_renewal(config, domains):
|
|||||||
"in its domain-name coverage, you must use the --duplicate "
|
"in its domain-name coverage, you must use the --duplicate "
|
||||||
"option.{br}{br}For example:{br}{br}{1} --duplicate {2}".format(
|
"option.{br}{br}For example:{br}{br}{1} --duplicate {2}".format(
|
||||||
"duplicates" if ident_names_cert is not None else
|
"duplicates" if ident_names_cert is not None else
|
||||||
"overlaps with", sys.argv[0], " ".join(sys.argv[1:])),
|
"overlaps with",
|
||||||
|
sys.argv[0], " ".join(sys.argv[1:]),
|
||||||
|
br=os.linesep
|
||||||
|
),
|
||||||
reporter_util.HIGH_PRIORITY)
|
reporter_util.HIGH_PRIORITY)
|
||||||
raise errors.Error(
|
raise errors.Error(
|
||||||
"User did not use proper CLI and would like "
|
"User did not use proper CLI and would like "
|
||||||
@@ -288,6 +292,7 @@ def _auth_from_domains(le_client, config, domains, plugins):
|
|||||||
|
|
||||||
return lineage
|
return lineage
|
||||||
|
|
||||||
|
|
||||||
# TODO: Make run as close to auth + install as possible
|
# TODO: Make run as close to auth + install as possible
|
||||||
# Possible difficulties: args.csr was hacked into auth
|
# Possible difficulties: args.csr was hacked into auth
|
||||||
def run(args, config, plugins): # pylint: disable=too-many-branches,too-many-locals
|
def run(args, config, plugins): # pylint: disable=too-many-branches,too-many-locals
|
||||||
@@ -708,7 +713,7 @@ def create_parser(plugins, args):
|
|||||||
|
|
||||||
# For now unfortunately this constant just needs to match the code below;
|
# For now unfortunately this constant just needs to match the code below;
|
||||||
# there isn't an elegant way to autogenerate it in time.
|
# there isn't an elegant way to autogenerate it in time.
|
||||||
VERBS = ["run", "auth", "install", "revoke", "rollback", "config_changes",\
|
VERBS = ["run", "auth", "install", "revoke", "rollback", "config_changes",
|
||||||
"plugins"]
|
"plugins"]
|
||||||
|
|
||||||
|
|
||||||
@@ -862,7 +867,8 @@ def _handle_exception(exc_type, exc_value, trace, args):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Exiting abnormally:\n%s",
|
"Exiting abnormally:%s%s",
|
||||||
|
os.linesep,
|
||||||
"".join(traceback.format_exception(exc_type, exc_value, trace)))
|
"".join(traceback.format_exception(exc_type, exc_value, trace)))
|
||||||
|
|
||||||
if issubclass(exc_type, Exception) and (args is None or not args.debug):
|
if issubclass(exc_type, Exception) and (args is None or not args.debug):
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ class DuplicativeCertsTest(renewer_test.BaseRenewableCertTest):
|
|||||||
shutil.rmtree(self.tempdir)
|
shutil.rmtree(self.tempdir)
|
||||||
|
|
||||||
@mock.patch("letsencrypt.le_util.make_or_verify_dir")
|
@mock.patch("letsencrypt.le_util.make_or_verify_dir")
|
||||||
def test_find_duplicative_names(self, unused):
|
def test_find_duplicative_names(self, unused): # pylint: disable=unused-argument
|
||||||
from letsencrypt.cli import _find_duplicative_certs
|
from letsencrypt.cli import _find_duplicative_certs
|
||||||
test_cert = test_util.load_vector("cert-san.pem")
|
test_cert = test_util.load_vector("cert-san.pem")
|
||||||
with open(self.test_rc.cert, "w") as f:
|
with open(self.test_rc.cert, "w") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user