mirror of
https://github.com/certbot/certbot.git
synced 2026-08-04 12:32:02 +02:00
Remove unused code in apache (#6882)
To fix one of the two uncovered lines in certbot-apache, given in #6880. Instead of adding a test to just increase the coverage, this fixes the uncovered line by removing the unused code.
This commit is contained in:
committed by
Brad Warren
parent
4d2dfab4dd
commit
20ed165699
@@ -1076,23 +1076,6 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
|||||||
if "ssl_module" not in self.parser.modules:
|
if "ssl_module" not in self.parser.modules:
|
||||||
self.enable_mod("ssl", temp=temp)
|
self.enable_mod("ssl", temp=temp)
|
||||||
|
|
||||||
def make_addrs_sni_ready(self, addrs):
|
|
||||||
"""Checks to see if the server is ready for SNI challenges.
|
|
||||||
|
|
||||||
:param addrs: Addresses to check SNI compatibility
|
|
||||||
:type addrs: :class:`~certbot_apache.obj.Addr`
|
|
||||||
|
|
||||||
"""
|
|
||||||
# Version 2.4 and later are automatically SNI ready.
|
|
||||||
if self.version >= (2, 4):
|
|
||||||
return
|
|
||||||
|
|
||||||
for addr in addrs:
|
|
||||||
if not self.is_name_vhost(addr):
|
|
||||||
logger.debug("Setting VirtualHost at %s to be a name "
|
|
||||||
"based virtual host", addr)
|
|
||||||
self.add_name_vhost(addr)
|
|
||||||
|
|
||||||
def make_vhost_ssl(self, nonssl_vhost): # pylint: disable=too-many-locals
|
def make_vhost_ssl(self, nonssl_vhost): # pylint: disable=too-many-locals
|
||||||
"""Makes an ssl_vhost version of a nonssl_vhost.
|
"""Makes an ssl_vhost version of a nonssl_vhost.
|
||||||
|
|
||||||
|
|||||||
@@ -1336,15 +1336,6 @@ class MultipleVhostsTest(util.ApacheTest):
|
|||||||
|
|
||||||
return account_key, (achall1, achall2, achall3)
|
return account_key, (achall1, achall2, achall3)
|
||||||
|
|
||||||
def test_make_addrs_sni_ready(self):
|
|
||||||
self.config.version = (2, 2)
|
|
||||||
self.config.make_addrs_sni_ready(
|
|
||||||
set([obj.Addr.fromstring("*:443"), obj.Addr.fromstring("*:80")]))
|
|
||||||
self.assertTrue(self.config.parser.find_dir(
|
|
||||||
"NameVirtualHost", "*:80", exclude=False))
|
|
||||||
self.assertTrue(self.config.parser.find_dir(
|
|
||||||
"NameVirtualHost", "*:443", exclude=False))
|
|
||||||
|
|
||||||
def test_aug_version(self):
|
def test_aug_version(self):
|
||||||
mock_match = mock.Mock(return_value=["something"])
|
mock_match = mock.Mock(return_value=["something"])
|
||||||
self.config.aug.match = mock_match
|
self.config.aug.match = mock_match
|
||||||
|
|||||||
Reference in New Issue
Block a user