copy: avoid "plugin" where possible

This commit is contained in:
Alex Zorin 2021-03-04 22:26:24 +11:00
parent 651cc7cd07
commit a942c8112e
8 changed files with 18 additions and 18 deletions

View file

@ -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

View file

@ -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."
)
###################################################

View file

@ -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))

View file

@ -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,

View file

@ -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

View file

@ -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 '')
)

View file

@ -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'

View file

@ -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):