Fix typo: config.port -> config.dvsni_port.

This commit is contained in:
Jakub Warmuz 2015-06-01 21:38:32 +00:00
parent 2929039cf4
commit 5b957f27d6
No known key found for this signature in database
GPG key ID: 2A7BAD3A489B52EA
2 changed files with 8 additions and 8 deletions

View file

@ -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))

View file

@ -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"}