From 747bd2715f83dd0262052d67aac58519ff0e3f66 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 2 Feb 2016 14:29:32 -0800 Subject: [PATCH] Fix merge bugs & address other review comments --- letsencrypt/cli.py | 4 +--- letsencrypt/tests/cli_test.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 6f9fa7229..92e985313 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -1337,8 +1337,6 @@ class WebrootPathProcessor(argparse.Action): # pylint: disable=missing-docstring args.webroot_path.append(webroot) -_undot = lambda domain: domain[:-1] if domain.endswith('.') else domain - def _process_domain(args_or_config, domain_arg, webroot_path=None): """ Process a new -d flag, helping the webroot plugin construct a map of @@ -1352,8 +1350,8 @@ def _process_domain(args_or_config, domain_arg, webroot_path=None): webroot_path = webroot_path if webroot_path else args_or_config.webroot_path for domain in (d.strip() for d in domain_arg.split(",")): + domain = le_util.enforce_domain_sanity(domain) if domain not in args_or_config.domains: - domain = _undot(domain) args_or_config.domains.append(domain) # Each domain has a webroot_path of the most recent -w flag # unless it was explicitly included in webroot_map diff --git a/letsencrypt/tests/cli_test.py b/letsencrypt/tests/cli_test.py index 7529f4548..f0ac954f9 100644 --- a/letsencrypt/tests/cli_test.py +++ b/letsencrypt/tests/cli_test.py @@ -235,7 +235,7 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods with mock.patch("letsencrypt.cli._init_le_client") as mock_init: with mock.patch("letsencrypt.cli._auth_from_domains"): self._call(["certonly", "--manual", "-d", "foo.bar"]) - _config, auth, _installer = mock_init.call_args[0] + unused_config, auth, unused_installer = mock_init.call_args[0] self.assertTrue(isinstance(auth, manual.Authenticator)) with MockedVerb("certonly") as mock_certonly: @@ -316,7 +316,7 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods '--chain-path', 'chain', '--fullchain-path', 'fullchain']) - config, _plugins = mock_obtaincert.call_args[0] + config, unused_plugins = mock_obtaincert.call_args[0] self.assertEqual(config.cert_path, os.path.abspath(cert)) self.assertEqual(config.key_path, os.path.abspath(key)) self.assertEqual(config.chain_path, os.path.abspath(chain))