From 5b957f27d67b07bbffc292f1229e4b37c99ca98c Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Mon, 1 Jun 2015 21:38:32 +0000 Subject: [PATCH] Fix typo: config.port -> config.dvsni_port. --- letsencrypt/plugins/standalone/authenticator.py | 10 +++++----- .../plugins/standalone/tests/authenticator_test.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/letsencrypt/plugins/standalone/authenticator.py b/letsencrypt/plugins/standalone/authenticator.py index 599c34395..8c06d1139 100644 --- a/letsencrypt/plugins/standalone/authenticator.py +++ b/letsencrypt/plugins/standalone/authenticator.py @@ -379,7 +379,7 @@ class StandaloneAuthenticator(common.Plugin): if not self.tasks: raise ValueError("nothing for .perform() to do") - if self.already_listening(self.config.port): + if self.already_listening(self.config.dvsni_port): # If we know a process is already listening on this port, # tell the user, and don't even attempt to bind it. (This # test is Linux-specific and won't indicate that the port @@ -387,7 +387,7 @@ class StandaloneAuthenticator(common.Plugin): return results_if_failure # Try to do the authentication; note that this creates # the listener subprocess via os.fork() - if self.start_listener(self.config.port, key): + if self.start_listener(self.config.dvsni_port, key): return results_if_success else: # TODO: This should probably raise a DVAuthError exception @@ -424,9 +424,9 @@ class StandaloneAuthenticator(common.Plugin): def more_info(self): # pylint: disable=no-self-use """Human-readable string that describes the Authenticator.""" return ("The Standalone Authenticator uses PyOpenSSL to listen " - "on port {port} and perform DVSNI challenges. Once a certificate " - "is attained, it will be saved in the " + "on port {port} and perform DVSNI challenges. Once a " + "certificate is attained, it will be saved in the " "(TODO) current working directory.{linesep}{linesep}" "TCP port {port} must be available in order to use the " "Standalone Authenticator.".format( - linesep=os.linesep, port=self.config.port)) + linesep=os.linesep, port=self.config.dvsni_port)) diff --git a/letsencrypt/plugins/standalone/tests/authenticator_test.py b/letsencrypt/plugins/standalone/tests/authenticator_test.py index 005ba5682..841285750 100644 --- a/letsencrypt/plugins/standalone/tests/authenticator_test.py +++ b/letsencrypt/plugins/standalone/tests/authenticator_test.py @@ -22,7 +22,7 @@ KEY = le_util.Key("foo", pkg_resources.resource_string( "acme.jose", os.path.join("testdata", "rsa512_key.pem"))) PRIVATE_KEY = OpenSSL.crypto.load_privatekey( OpenSSL.crypto.FILETYPE_PEM, KEY.pem) -CONFIG = mock.Mock(port=5001) +CONFIG = mock.Mock(dvsni_port=5001) # Classes based on to allow interrupting infinite loop under test @@ -329,7 +329,7 @@ class PerformTest(unittest.TestCase): self.assertTrue(isinstance(result[1], challenges.ChallengeResponse)) self.assertFalse(result[2]) self.authenticator.start_listener.assert_called_once_with( - CONFIG.port, KEY) + CONFIG.dvsni_port, KEY) def test_cannot_perform(self): """What happens if start_listener() returns False.""" @@ -345,7 +345,7 @@ class PerformTest(unittest.TestCase): self.assertEqual(len(result), 3) self.assertEqual(result, [None, None, False]) self.authenticator.start_listener.assert_called_once_with( - CONFIG.port, KEY) + CONFIG.dvsni_port, KEY) def test_perform_with_pending_tasks(self): self.authenticator.tasks = {"foononce.acme.invalid": "cert_data"}