mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 00:22:28 +02:00
Refactored the port check from NamespaceConfig init to the validation function
This commit is contained in:
@@ -38,10 +38,6 @@ class NamespaceConfig(object):
|
|||||||
def __init__(self, namespace):
|
def __init__(self, namespace):
|
||||||
self.namespace = namespace
|
self.namespace = namespace
|
||||||
check_config_sanity(self)
|
check_config_sanity(self)
|
||||||
if self.http01_port == self.tls_sni_01_port:
|
|
||||||
raise errors.Error(
|
|
||||||
"Trying to run http-01 and tls-sni-01 "
|
|
||||||
"on the same port ({0})".format(self.tls_sni_01_port))
|
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return getattr(self.namespace, name)
|
return getattr(self.namespace, name)
|
||||||
@@ -122,6 +118,12 @@ def check_config_sanity(config):
|
|||||||
:type args: :class:`letsencrypt.interfaces.IConfig`
|
:type args: :class:`letsencrypt.interfaces.IConfig`
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
# Port check
|
||||||
|
if config.http01_port == config.tls_sni_01_port:
|
||||||
|
raise errors.Error(
|
||||||
|
"Trying to run http-01 and tls-sni-01 "
|
||||||
|
"on the same port ({0})".format(config.tls_sni_01_port))
|
||||||
|
|
||||||
# Domain checks
|
# Domain checks
|
||||||
if config.namespace.domains is not None:
|
if config.namespace.domains is not None:
|
||||||
_check_config_domain_sanity(config.namespace.domains)
|
_check_config_domain_sanity(config.namespace.domains)
|
||||||
|
|||||||
Reference in New Issue
Block a user