From 128147af3b540979a51a4a4074b57f7cb4a065da Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 14 Oct 2015 12:27:18 -0700 Subject: [PATCH] Removed misleading renewal messages --- letsencrypt/client.py | 26 -------------------------- letsencrypt/tests/client_test.py | 31 ------------------------------- 2 files changed, 57 deletions(-) diff --git a/letsencrypt/client.py b/letsencrypt/client.py index 123bab121..bb04f4f5a 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -5,7 +5,6 @@ import os from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa import OpenSSL -import zope.component from acme import client as acme_client from acme import jose @@ -19,7 +18,6 @@ from letsencrypt import continuity_auth from letsencrypt import crypto_util from letsencrypt import errors from letsencrypt import error_handler -from letsencrypt import interfaces from letsencrypt import le_util from letsencrypt import reverter from letsencrypt import storage @@ -258,32 +256,8 @@ class Client(object): OpenSSL.crypto.FILETYPE_PEM, certr.body), key.pem, crypto_util.dump_pyopenssl_chain(chain), params, config, cli_config) - self._report_renewal_status(lineage) return lineage - def _report_renewal_status(self, cert): - # pylint: disable=no-self-use - """Informs the user about automatic renewal and deployment. - - :param .RenewableCert cert: Newly issued certificate - - """ - if cert.autorenewal_is_enabled(): - if cert.autodeployment_is_enabled(): - msg = "Automatic renewal and deployment has " - else: - msg = "Automatic renewal but not automatic deployment has " - elif cert.autodeployment_is_enabled(): - msg = "Automatic deployment but not automatic renewal has " - else: - msg = "Automatic renewal and deployment has not " - - msg += ("been enabled for your certificate. These settings can be " - "configured in the directories under {0}.").format( - cert.cli_config.renewal_configs_dir) - reporter = zope.component.getUtility(interfaces.IReporter) - reporter.add_message(msg, reporter.LOW_PRIORITY) - def save_certificate(self, certr, chain_cert, cert_path, chain_path): # pylint: disable=no-self-use """Saves the certificate received from the ACME server. diff --git a/letsencrypt/tests/client_test.py b/letsencrypt/tests/client_test.py index fddb86607..9a5a2bbe1 100644 --- a/letsencrypt/tests/client_test.py +++ b/letsencrypt/tests/client_test.py @@ -114,37 +114,6 @@ class ClientTest(unittest.TestCase): mock.sentinel.key, domains, self.config.csr_dir) self._check_obtain_certificate() - @mock.patch("letsencrypt.client.zope.component.getUtility") - def test_report_renewal_status(self, mock_zope): - # pylint: disable=protected-access - cert = mock.MagicMock() - cert.cli_config.renewal_configs_dir = "/foo/bar/baz" - - cert.autorenewal_is_enabled.return_value = True - cert.autodeployment_is_enabled.return_value = True - self.client._report_renewal_status(cert) - msg = mock_zope().add_message.call_args[0][0] - self.assertTrue("renewal and deployment has been" in msg) - self.assertTrue(cert.cli_config.renewal_configs_dir in msg) - - cert.autorenewal_is_enabled.return_value = False - self.client._report_renewal_status(cert) - msg = mock_zope().add_message.call_args[0][0] - self.assertTrue("deployment but not automatic renewal" in msg) - self.assertTrue(cert.cli_config.renewal_configs_dir in msg) - - cert.autodeployment_is_enabled.return_value = False - self.client._report_renewal_status(cert) - msg = mock_zope().add_message.call_args[0][0] - self.assertTrue("renewal and deployment has not" in msg) - self.assertTrue(cert.cli_config.renewal_configs_dir in msg) - - cert.autorenewal_is_enabled.return_value = True - self.client._report_renewal_status(cert) - msg = mock_zope().add_message.call_args[0][0] - self.assertTrue("renewal but not automatic deployment" in msg) - self.assertTrue(cert.cli_config.renewal_configs_dir in msg) - def test_save_certificate(self): certs = ["matching_cert.pem", "cert.pem", "cert-san.pem"] tmp_path = tempfile.mkdtemp()