catch up to python3 changes

This commit is contained in:
Alex Zorin 2021-04-22 17:44:16 +10:00
parent fa83d6a51c
commit 7cf835059e
2 changed files with 4 additions and 12 deletions

View file

@ -556,8 +556,7 @@ class ApacheConfigurator(common.Installer):
return list(matched)
def _raise_no_suitable_vhost_error(self, target_name):
# type: (str) -> None
def _raise_no_suitable_vhost_error(self, target_name: str):
"""
Notifies the user that Certbot could not find a vhost to secure
and raises an error.
@ -1540,10 +1539,9 @@ class ApacheConfigurator(common.Installer):
if sift:
display_util.notify(
"Some rewrite rules copied from {src_path} were disabled in the "
"vhost for your HTTPS site located at {dest_path} because they have "
f"Some rewrite rules copied from {vhost.filep} were disabled in the "
f"vhost for your HTTPS site located at {ssl_fp} because they have "
"the potential to create redirection loops."
.format(src_path=vhost.filep, dest_path=ssl_fp)
)
self.parser.aug.set("/augeas/files%s/mtime" % (self._escape(ssl_fp)), "0")
self.parser.aug.set("/augeas/files%s/mtime" % (self._escape(vhost.filep)), "0")

View file

@ -1,11 +1,6 @@
"""Test for certbot_apache._internal.configurator for CentOS 6 overrides"""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
import six # pylint: disable=unused-import # six is used in mock.patch()
from unittest import mock
from certbot.compat import os
from certbot.errors import MisconfigurationError
@ -15,7 +10,6 @@ from certbot_apache._internal import parser
import util
def get_vh_truth(temp_dir, config_name):
"""Return the ground truth for the specified directory."""
prefix = os.path.join(