standalone2: move alread_listening to perform

This commit is contained in:
Jakub Warmuz
2015-10-15 18:01:14 +00:00
parent e7809563b1
commit 6f44bcf117
2 changed files with 13 additions and 11 deletions
+7 -5
View File
@@ -182,11 +182,7 @@ class Authenticator(common.Plugin):
return self.__doc__
def prepare(self): # pylint: disable=missing-docstring
if any(util.already_listening(port) for port in
(self.config.dvsni_port, self.config.simple_http_port)):
raise errors.MisconfigurationError(
"At least one of the (possibly) required ports is "
"already taken.")
pass
def get_chall_pref(self, domain):
# pylint: disable=unused-argument,missing-docstring
@@ -195,6 +191,12 @@ class Authenticator(common.Plugin):
return chall_pref
def perform(self, achalls): # pylint: disable=missing-docstring
if any(util.already_listening(port) for port in
(self.config.dvsni_port, self.config.simple_http_port)):
raise errors.MisconfigurationError(
"At least one of the (possibly) required ports is "
"already taken.")
try:
return self.perform2(achalls)
except errors.StandaloneBindError as error: