From 4646d8d6bfd1d537657a163803c43201e735ea1f Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 2 Jun 2015 18:30:48 +0000 Subject: [PATCH] Standalone Authenticator: no fail when port taken (fixes #381) --- letsencrypt/plugins/standalone/authenticator.py | 1 - letsencrypt/plugins/standalone/tests/authenticator_test.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/letsencrypt/plugins/standalone/authenticator.py b/letsencrypt/plugins/standalone/authenticator.py index 8c06d1139..2ed60a096 100644 --- a/letsencrypt/plugins/standalone/authenticator.py +++ b/letsencrypt/plugins/standalone/authenticator.py @@ -152,7 +152,6 @@ class StandaloneAuthenticator(common.Plugin): :rtype: bool """ - display = zope.component.getUtility(interfaces.IDisplay) start_time = time.time() diff --git a/letsencrypt/plugins/standalone/tests/authenticator_test.py b/letsencrypt/plugins/standalone/tests/authenticator_test.py index 841285750..1794ff65c 100644 --- a/letsencrypt/plugins/standalone/tests/authenticator_test.py +++ b/letsencrypt/plugins/standalone/tests/authenticator_test.py @@ -317,6 +317,7 @@ class PerformTest(unittest.TestCase): """What happens if start_listener() returns True.""" self.authenticator.start_listener = mock.Mock() self.authenticator.start_listener.return_value = True + self.authenticator.already_listening = mock.Mock(return_value=False) result = self.authenticator.perform(self.achalls) self.assertEqual(len(self.authenticator.tasks), 2) self.assertTrue( @@ -335,6 +336,7 @@ class PerformTest(unittest.TestCase): """What happens if start_listener() returns False.""" self.authenticator.start_listener = mock.Mock() self.authenticator.start_listener.return_value = False + self.authenticator.already_listening = mock.Mock(return_value=False) result = self.authenticator.perform(self.achalls) self.assertEqual(len(self.authenticator.tasks), 2) self.assertTrue(