From a942c8112e405e8050191c88209476d03ab613f3 Mon Sep 17 00:00:00 2001 From: Alex Zorin Date: Thu, 4 Mar 2021 22:26:24 +1100 Subject: [PATCH] copy: avoid "plugin" where possible --- certbot-apache/certbot_apache/_internal/configurator.py | 4 ++-- certbot-nginx/certbot_nginx/_internal/configurator.py | 4 ++-- certbot/certbot/_internal/auth_handler.py | 6 +++--- certbot/certbot/_internal/plugins/manual.py | 2 +- certbot/certbot/_internal/plugins/webroot.py | 6 +++--- certbot/certbot/plugins/dns_common.py | 6 +++--- certbot/tests/auth_handler_test.py | 4 ++-- certbot/tests/plugins/manual_test.py | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/certbot-apache/certbot_apache/_internal/configurator.py b/certbot-apache/certbot_apache/_internal/configurator.py index f5e029fbc..538707b46 100644 --- a/certbot-apache/certbot_apache/_internal/configurator.py +++ b/certbot-apache/certbot_apache/_internal/configurator.py @@ -2472,8 +2472,8 @@ class ApacheConfigurator(common.Installer): def auth_hint(self, failed_achalls): # pragma: no cover return ("The Certificate Authority failed to verify the temporary Apache configuration " - "changes made by the --apache plugin. Ensure that the above domains point to " - "this Apache server and that it is accessible from the internet.") + "changes made by Certbot. Ensure that the listed domains point to this Apache " + "server and that it is accessible from the internet.") ########################################################################### # Challenges Section diff --git a/certbot-nginx/certbot_nginx/_internal/configurator.py b/certbot-nginx/certbot_nginx/_internal/configurator.py index b2a66515e..108a9770f 100644 --- a/certbot-nginx/certbot_nginx/_internal/configurator.py +++ b/certbot-nginx/certbot_nginx/_internal/configurator.py @@ -1032,8 +1032,8 @@ class NginxConfigurator(common.Installer): def auth_hint(self, failed_achalls): # pragma: no cover return ( "The Certificate Authority failed to verify the temporary nginx configuration changes " - "made by the --nginx plugin. Ensure the above domains point to this nginx server and " - "that it is accessible from the internet, or try increasing --nginx-sleep-seconds." + "made by Certbot. Ensure the listed domains point to this nginx server and that it is " + "accessible from the internet." ) ################################################### diff --git a/certbot/certbot/_internal/auth_handler.py b/certbot/certbot/_internal/auth_handler.py index 9be04c82a..fcfd66d47 100644 --- a/certbot/certbot/_internal/auth_handler.py +++ b/certbot/certbot/_internal/auth_handler.py @@ -277,8 +277,8 @@ class AuthHandler(object): for achall in failed_achalls: problems.setdefault(achall.error.typ, []).append(achall) - msg = ["\nCertbot failed to authenticate some domains (using the {} plugin)." - " The Certificate Authority reported these problems:".format(self.auth.name)] + msg = [f"\nCertbot failed to authenticate some domains (authenticator: {self.auth.name})." + " The Certificate Authority reported these problems:"] for _, achalls in sorted(problems.items(), key=lambda item: item[0]): msg.append(_generate_failed_chall_msg(achalls)) @@ -286,7 +286,7 @@ class AuthHandler(object): # auth_hint will only be called on authenticators that subclass # plugin_common.Plugin. Refer to comment on that function. if failed_achalls and isinstance(self.auth, plugin_common.Plugin): - msg.append('\nHint: {}\n'.format(self.auth.auth_hint(failed_achalls))) + msg.append(f"\nHint: {self.auth.auth_hint(failed_achalls)}\n") display_util.notify("".join(msg)) diff --git a/certbot/certbot/_internal/plugins/manual.py b/certbot/certbot/_internal/plugins/manual.py index 2c632e8b1..7e6aa6fba 100644 --- a/certbot/certbot/_internal/plugins/manual.py +++ b/certbot/certbot/_internal/plugins/manual.py @@ -124,7 +124,7 @@ permitted by DNS standards.) return ( 'The Certificate Authority failed to verify the {resources} created by the ' '--manual-auth-hook. Ensure that this hook is functioning correctly{dns_hint}. ' - 'Refer to "{certbot} --help manual".' + 'Refer to "{certbot} --help manual" and the Certbot User Guide.' .format( certbot=cli_constants.cli_command, resources=resources, diff --git a/certbot/certbot/_internal/plugins/webroot.py b/certbot/certbot/_internal/plugins/webroot.py index cbb3cacfc..f383ca3bb 100644 --- a/certbot/certbot/_internal/plugins/webroot.py +++ b/certbot/certbot/_internal/plugins/webroot.py @@ -64,9 +64,9 @@ to serve all files under specified web root ({0}).""" def auth_hint(self, failed_achalls): # pragma: no cover return ("The Certificate Authority failed to download the temporary challenge files " - "created by the --webroot plugin. Ensure that the above domains serve their " - "content from the provided --webroot-path/-w and that files created there " - "can be downloaded from the internet.") + "created by Certbot. Ensure that the listed domains serve their content from " + "the provided --webroot-path/-w and that files created there can be downloaded " + "from the internet.") def get_chall_pref(self, domain): # pragma: no cover # pylint: disable=unused-argument,missing-function-docstring diff --git a/certbot/certbot/plugins/dns_common.py b/certbot/certbot/plugins/dns_common.py index 25c2b55e0..7cbe121b3 100644 --- a/certbot/certbot/plugins/dns_common.py +++ b/certbot/certbot/plugins/dns_common.py @@ -40,9 +40,9 @@ class DNSAuthenticator(common.Plugin): def auth_hint(self, failed_achalls): delay = self.conf('propagation-seconds') return ( - 'The Certificate Authority failed to verify the DNS TXT records created by the ' - '{name} plugin. Ensure the above domains are hosted by this DNS provider, ' - 'or try increasing --{name}-propagation-seconds (currently {secs} second{suffix}).' + 'The Certificate Authority failed to verify the DNS TXT records created by --{name}. ' + 'Ensure the above domains are hosted by this DNS provider, or try increasing ' + '--{name}-propagation-seconds (currently {secs} second{suffix}).' .format(name=self.name, secs=delay, suffix='s' if delay != 1 else '') ) diff --git a/certbot/tests/auth_handler_test.py b/certbot/tests/auth_handler_test.py index b74fbfd3b..a207f4dc9 100644 --- a/certbot/tests/auth_handler_test.py +++ b/certbot/tests/auth_handler_test.py @@ -519,7 +519,7 @@ class ReportFailedAuthzrsTest(unittest.TestCase): self.handler._report_failed_authzrs([self.authzr1]) mock_notify.assert_called_with( '\n' - 'Certbot failed to authenticate some domains (using the buzz plugin). ' + 'Certbot failed to authenticate some domains (authenticator: buzz). ' 'The Certificate Authority reported these problems:\n' ' Domain: example.com\n' ' Type: tls\n' @@ -538,7 +538,7 @@ class ReportFailedAuthzrsTest(unittest.TestCase): self.handler._report_failed_authzrs([self.authzr1, self.authzr2]) mock_notify.assert_called_with( '\n' - 'Certbot failed to authenticate some domains (using the quux plugin). ' + 'Certbot failed to authenticate some domains (authenticator: quux). ' 'The Certificate Authority reported these problems:\n' ' Domain: foo.bar\n' ' Type: dnssec\n' diff --git a/certbot/tests/plugins/manual_test.py b/certbot/tests/plugins/manual_test.py index d1b7b768c..7c00daaf3 100644 --- a/certbot/tests/plugins/manual_test.py +++ b/certbot/tests/plugins/manual_test.py @@ -129,13 +129,13 @@ class AuthenticatorTest(test_util.TempDirTestCase): 'The Certificate Authority failed to verify the DNS TXT records and challenge ' 'files created by the --manual-auth-hook. Ensure that this hook is functioning ' 'correctly and that it waits a sufficient duration of time for DNS propagation. ' - 'Refer to "certbot --help manual".' + 'Refer to "certbot --help manual" and the Certbot User Guide.' ) self.assertEqual( self.auth.auth_hint([acme_util.HTTP01_A]), 'The Certificate Authority failed to verify the challenge files created by the ' '--manual-auth-hook. Ensure that this hook is functioning correctly. Refer to ' - '"certbot --help manual".' + '"certbot --help manual" and the Certbot User Guide.' ) def test_auth_hint_no_hook(self):