Skip to content

Commit

Permalink
Uncomment simplehttp/dvsni port check
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba committed Oct 14, 2015
1 parent 244a020 commit 9b77c9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 5 additions & 5 deletions letsencrypt/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from acme import challenges

from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import interfaces


Expand Down Expand Up @@ -36,11 +37,10 @@ class NamespaceConfig(object):
def __init__(self, namespace):
self.namespace = namespace

# XXX: breaks renewer in some bizarre way
#if self.simple_http_port == self.dvsni_port:
# raise errors.Error(
# "Trying to run SimpleHTTP non-TLS and DVSNI "
# "on the same port ({0})".format(self.dvsni_port))
if self.simple_http_port == self.dvsni_port:
raise errors.Error(
"Trying to run SimpleHTTP and DVSNI "
"on the same port ({0})".format(self.dvsni_port))

def __getattr__(self, name):
return getattr(self.namespace, name)
Expand Down
9 changes: 8 additions & 1 deletion letsencrypt/tests/configuration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import mock

from letsencrypt import errors


class NamespaceConfigTest(unittest.TestCase):
"""Tests for letsencrypt.configuration.NamespaceConfig."""
Expand All @@ -12,10 +14,15 @@ def setUp(self):
self.namespace = mock.MagicMock(
config_dir='/tmp/config', work_dir='/tmp/foo', foo='bar',
server='https://acme-server.org:443/new',
dvsni_port='1234', simple_http_port=4321)
dvsni_port=1234, simple_http_port=4321)
from letsencrypt.configuration import NamespaceConfig
self.config = NamespaceConfig(self.namespace)

def test_init_same_ports(self):
self.namespace.dvsni_port = 4321
from letsencrypt.configuration import NamespaceConfig
self.assertRaises(errors.Error, NamespaceConfig, self.namespace)

def test_proxy_getattr(self):
self.assertEqual(self.config.foo, 'bar')
self.assertEqual(self.config.work_dir, '/tmp/foo')
Expand Down

0 comments on commit 9b77c9a

Please sign in to comment.