diff options
author | Brad Warren <bmw@users.noreply.github.com> | 2020-11-06 02:28:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 02:28:35 +0300 |
commit | 75365f1d4e92c552f8ec69b97c0534adbd51f1d6 (patch) | |
tree | b6e19eb17593b594b8e811395d208c09d527aad7 /certbot-apache | |
parent | e570e8ad3230ed5ce24191cde9bbbc6d2a54b630 (diff) |
Remove python_version setting from mypy.ini (#8426)
* Remove python_version from mypy.ini.
* Fix magic_typing
* Ignore msvcrt usage.
* make mypy happier
* clean up changes
* Add type for reporter queue
* More mypy fixes
* Fix pyrfc3339 str.
* Remove unused import.
* Make certbot.util mypy work in both Pythons
* Fix typo
Diffstat (limited to 'certbot-apache')
-rw-r--r-- | certbot-apache/certbot_apache/_internal/configurator.py | 18 | ||||
-rw-r--r-- | certbot-apache/tests/configurator_test.py | 7 |
2 files changed, 1 insertions, 24 deletions
diff --git a/certbot-apache/certbot_apache/_internal/configurator.py b/certbot-apache/certbot_apache/_internal/configurator.py index 4e0a73ac1..c20a4fdd6 100644 --- a/certbot-apache/certbot_apache/_internal/configurator.py +++ b/certbot-apache/certbot_apache/_internal/configurator.py @@ -9,7 +9,6 @@ import re import socket import time -import six import zope.component import zope.interface try: @@ -464,21 +463,6 @@ class ApacheConfigurator(common.Installer): metadata=metadata ) - def _wildcard_domain(self, domain): - """ - Checks if domain is a wildcard domain - - :param str domain: Domain to check - - :returns: If the domain is wildcard domain - :rtype: bool - """ - if isinstance(domain, six.text_type): - wildcard_marker = u"*." - else: - wildcard_marker = b"*." - return domain.startswith(wildcard_marker) - def deploy_cert(self, domain, cert_path, key_path, chain_path=None, fullchain_path=None): """Deploys certificate to specified virtual host. @@ -513,7 +497,7 @@ class ApacheConfigurator(common.Installer): :rtype: `list` of :class:`~certbot_apache._internal.obj.VirtualHost` """ - if self._wildcard_domain(domain): + if util.is_wildcard_domain(domain): if domain in self._wildcard_vhosts: # Vhosts for a wildcard domain were already selected return self._wildcard_vhosts[domain] diff --git a/certbot-apache/tests/configurator_test.py b/certbot-apache/tests/configurator_test.py index 091a6a828..38d07aefe 100644 --- a/certbot-apache/tests/configurator_test.py +++ b/certbot-apache/tests/configurator_test.py @@ -1337,13 +1337,6 @@ class MultipleVhostsTest(util.ApacheTest): self.config.enable_mod, "whatever") - def test_wildcard_domain(self): - # pylint: disable=protected-access - cases = {u"*.example.org": True, b"*.x.example.org": True, - u"a.example.org": False, b"a.x.example.org": False} - for key in cases: - self.assertEqual(self.config._wildcard_domain(key), cases[key]) - def test_choose_vhosts_wildcard(self): # pylint: disable=protected-access mock_path = "certbot_apache._internal.display_ops.select_vhost_multiple" |