From 63e1c652e18f98850f529173494cfbbd0a2905df Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Sat, 26 Sep 2015 18:05:17 -0700 Subject: [PATCH 1/3] Undo damage from PEP8ification --- letsencrypt/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 7cb4a0458..81f8a8414 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -484,7 +484,7 @@ class HelpfulArgumentParser(object): help2 = self.prescan_for_flag("--help", self.help_topics) assert max(True, "a") == "a", "Gravity changed direction" help_arg = max(help1, help2) - if help_arg: + if help_arg == True: # just --help with no topic; avoid argparse altogether print USAGE sys.exit(0) From 405bc99235754b661224a18753bdb8a8ec3ff60d Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Sat, 26 Sep 2015 18:19:56 -0700 Subject: [PATCH 2/3] --help is effectively a verb for CLI purposes --- letsencrypt/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 81f8a8414..a5968ec9c 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -679,7 +679,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", - "plugins"] + "plugins", "--help"] def _create_subparsers(helpful): From e7cbdc4f9a0e021b385a8eb1869a21011d5e7840 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Sat, 26 Sep 2015 18:20:13 -0700 Subject: [PATCH 3/3] Revert reversion Revert "Revert "ManualAuthenticator -> Authenticator"" (commit required a pip reinstall but was not inherently broken) This reverts commit 6f1b1570b13d9e41dceaca909ebf417469609ee7. --- letsencrypt/plugins/manual.py | 4 ++-- letsencrypt/plugins/manual_test.py | 10 +++++----- setup.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/letsencrypt/plugins/manual.py b/letsencrypt/plugins/manual.py index 43d0ac055..2014c8c0e 100644 --- a/letsencrypt/plugins/manual.py +++ b/letsencrypt/plugins/manual.py @@ -23,7 +23,7 @@ from letsencrypt.plugins import common logger = logging.getLogger(__name__) -class ManualAuthenticator(common.Plugin): +class Authenticator(common.Plugin): """Manual Authenticator. .. todo:: Support for `~.challenges.DVSNI`. @@ -87,7 +87,7 @@ s.serve_forever()" """ """ def __init__(self, *args, **kwargs): - super(ManualAuthenticator, self).__init__(*args, **kwargs) + super(Authenticator, self).__init__(*args, **kwargs) self.template = (self.HTTP_TEMPLATE if self.config.no_simple_http_tls else self.HTTPS_TEMPLATE) self._root = (tempfile.mkdtemp() if self.conf("test-mode") diff --git a/letsencrypt/plugins/manual_test.py b/letsencrypt/plugins/manual_test.py index 6b9359db1..cfe47b833 100644 --- a/letsencrypt/plugins/manual_test.py +++ b/letsencrypt/plugins/manual_test.py @@ -17,22 +17,22 @@ from letsencrypt.tests import test_util KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem")) -class ManualAuthenticatorTest(unittest.TestCase): - """Tests for letsencrypt.plugins.manual.ManualAuthenticator.""" +class AuthenticatorTest(unittest.TestCase): + """Tests for letsencrypt.plugins.manual.Authenticator.""" def setUp(self): - from letsencrypt.plugins.manual import ManualAuthenticator + from letsencrypt.plugins.manual import Authenticator self.config = mock.MagicMock( no_simple_http_tls=True, simple_http_port=4430, manual_test_mode=False) - self.auth = ManualAuthenticator(config=self.config, name="manual") + self.auth = Authenticator(config=self.config, name="manual") self.achalls = [achallenges.SimpleHTTP( challb=acme_util.SIMPLE_HTTP_P, domain="foo.com", account_key=KEY)] config_test_mode = mock.MagicMock( no_simple_http_tls=True, simple_http_port=4430, manual_test_mode=True) - self.auth_test_mode = ManualAuthenticator( + self.auth_test_mode = Authenticator( config=config_test_mode, name="manual") def test_more_info(self): diff --git a/setup.py b/setup.py index b43365a98..c568d2872 100644 --- a/setup.py +++ b/setup.py @@ -117,7 +117,7 @@ setup( 'letsencrypt-renewer = letsencrypt.renewer:main', ], 'letsencrypt.plugins': [ - 'manual = letsencrypt.plugins.manual:ManualAuthenticator', + 'manual = letsencrypt.plugins.manual:Authenticator', # TODO: null should probably not be presented to the user 'null = letsencrypt.plugins.null:Installer', 'standalone = letsencrypt.plugins.standalone.authenticator'