cli: remove trailing newline on new cert reporting

This commit is contained in:
Alex Zorin 2021-05-18 10:53:22 +10:00
parent 2e16ef3955
commit a7e879bed8
2 changed files with 6 additions and 5 deletions

View file

@ -493,7 +493,7 @@ def _report_new_cert(config, cert_path, fullchain_path, key_path=None):
("\nSuccessfully received certificate.\n"
"Certificate is saved at: {cert_path}\n{key_msg}"
"This certificate expires on {expiry}.\n"
"These files will be updated when the certificate renews.\n{renew_msg}\n").format(
"These files will be updated when the certificate renews.\n{renew_msg}{nl}").format(
cert_path=fullchain_path,
expiry=crypto_util.notAfter(cert_path).date(),
key_msg="Key is saved at: {}\n".format(key_path) if key_path else "",
@ -503,7 +503,8 @@ def _report_new_cert(config, cert_path, fullchain_path, key_path=None):
"expiring certificates. "
"We recommend setting up a scheduled task for renewal; see "
"https://certbot.eff.org/docs/using.html#automated-renewals "
"for instructions.")
"for instructions."),
nl="\n" if config.verb == "run" else "" # visually split output if also deploying
)
)

View file

@ -1807,7 +1807,7 @@ class ReportNewCertTest(unittest.TestCase):
'Key is saved at: /path/to/privkey.pem\n'
'This certificate expires on 1970-01-01.\n'
'These files will be updated when the certificate renews.\n'
'Certbot will automatically renew this certificate in the background.\n'
'Certbot will automatically renew this certificate in the background.'
)
def test_report_no_key(self):
@ -1820,7 +1820,7 @@ class ReportNewCertTest(unittest.TestCase):
'Certificate is saved at: /path/to/fullchain.pem\n'
'This certificate expires on 1970-01-01.\n'
'These files will be updated when the certificate renews.\n'
'Certbot will automatically renew this certificate in the background.\n'
'Certbot will automatically renew this certificate in the background.'
)
def test_report_no_preconfigured_renewal(self):
@ -1836,7 +1836,7 @@ class ReportNewCertTest(unittest.TestCase):
'These files will be updated when the certificate renews.\n'
'Run "certbot renew" to renew expiring certificates. We recommend setting up a '
'scheduled task for renewal; see https://certbot.eff.org/docs/using.html#automated'
'-renewals for instructions.\n'
'-renewals for instructions.'
)