From e8611d299ad490fbefffd039d90d1f2676fd6ebb Mon Sep 17 00:00:00 2001 From: James Kasten Date: Wed, 16 Sep 2015 13:23:46 -0700 Subject: [PATCH] Cleanup formatting issues --- letsencrypt/cli.py | 16 +++++++++++----- letsencrypt/tests/cli_test.py | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index b4649a29a..88266aaeb 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -225,7 +225,7 @@ def _treat_as_renewal(config, domains): "You have an existing certificate that contains exactly the " "same domains you requested (ref: {0}){br}{br}Do you want to " "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: question = ( "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?" ).format(subset_names_cert.configfile.filename, ", ".join(subset_names_cert.names()), - ", ".join(domains)) + ", ".join(domains), + br=os.linesep) 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. @@ -250,7 +251,10 @@ def _treat_as_renewal(config, domains): "in its domain-name coverage, you must use the --duplicate " "option.{br}{br}For example:{br}{br}{1} --duplicate {2}".format( "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) raise errors.Error( "User did not use proper CLI and would like " @@ -288,6 +292,7 @@ def _auth_from_domains(le_client, config, domains, plugins): return lineage + # TODO: Make run as close to auth + install as possible # Possible difficulties: args.csr was hacked into auth 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; # 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"] @@ -862,7 +867,8 @@ def _handle_exception(exc_type, exc_value, trace, args): """ logger.debug( - "Exiting abnormally:\n%s", + "Exiting abnormally:%s%s", + os.linesep, "".join(traceback.format_exception(exc_type, exc_value, trace))) if issubclass(exc_type, Exception) and (args is None or not args.debug): diff --git a/letsencrypt/tests/cli_test.py b/letsencrypt/tests/cli_test.py index c38ece0e1..97725a4c7 100644 --- a/letsencrypt/tests/cli_test.py +++ b/letsencrypt/tests/cli_test.py @@ -177,7 +177,7 @@ class DuplicativeCertsTest(renewer_test.BaseRenewableCertTest): shutil.rmtree(self.tempdir) @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 test_cert = test_util.load_vector("cert-san.pem") with open(self.test_rc.cert, "w") as f: