From cf5cb9d3ff139da5090891e43f1b9cf3808f9c5e Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 21 Oct 2015 21:15:19 -0700 Subject: [PATCH] Satisfy pylint... sort of --- letsencrypt/client.py | 5 ++++- letsencrypt/tests/cli_test.py | 2 +- letsencrypt/tests/client_test.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/letsencrypt/client.py b/letsencrypt/client.py index a7a4847b2..31597c7d3 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -259,7 +259,7 @@ class Client(object): return lineage def save_certificate(self, certr, chain_cert, cert_path, chain_path, fullchain_path): - # pylint: disable=no-self-use + # pylint: disable=no-self-use,too-many-locals """Saves the certificate received from the ACME server. :param certr: ACME "certificate" resource. @@ -295,6 +295,9 @@ class Client(object): logger.info("Server issued certificate; certificate written to %s", act_cert_path) + # TODO too long, refactor... either split this into another function + # up one level (though it needs a copy of cert_pem) or find a way to + # reuse machinery from storage.py if chain_cert: chain_file, act_chain_path = le_util.unique_file(chain_path, 0o644) # TODO: Except diff --git a/letsencrypt/tests/cli_test.py b/letsencrypt/tests/cli_test.py index 73ab84bdf..8e9172055 100644 --- a/letsencrypt/tests/cli_test.py +++ b/letsencrypt/tests/cli_test.py @@ -180,7 +180,7 @@ class CLITest(unittest.TestCase): cert_path = '/etc/letsencrypt/live/foo.bar/cert.pem' chain_path = '/etc/letsencrypt/live/foo.bar/fullchain.pem' - mock_lineage = mock.MagicMock(cert=cert_path,fullchain=chain_path) + mock_lineage = mock.MagicMock(cert=cert_path, fullchain=chain_path) mock_cert = mock.MagicMock(body='body') mock_key = mock.MagicMock(pem='pem_key') mock_renewal.return_value = mock_lineage diff --git a/letsencrypt/tests/client_test.py b/letsencrypt/tests/client_test.py index 249778964..13613374f 100644 --- a/letsencrypt/tests/client_test.py +++ b/letsencrypt/tests/client_test.py @@ -114,7 +114,7 @@ class ClientTest(unittest.TestCase): mock.sentinel.key, domains, self.config.csr_dir) self._check_obtain_certificate() - def test_save_certificate(self): + def test_save_certificate(self): # pylint: disable=too-many-locals certs = ["matching_cert.pem", "cert.pem", "cert-san.pem"] tmp_path = tempfile.mkdtemp() os.chmod(tmp_path, 0o755) # TODO: really??