diff --git a/certbot/certbot/_internal/main.py b/certbot/certbot/_internal/main.py index 2e195bb86..4483599db 100644 --- a/certbot/certbot/_internal/main.py +++ b/certbot/certbot/_internal/main.py @@ -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 ) ) diff --git a/certbot/tests/main_test.py b/certbot/tests/main_test.py index 9e5ff6d00..816ceb536 100644 --- a/certbot/tests/main_test.py +++ b/certbot/tests/main_test.py @@ -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.' )