From 070fbd0213f3ddc1681afb7dcc0bbb400c3af9d9 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Sep 13 2021 07:04:39 +0000 Subject: add patch for compatibility with python3-dns < 2.0 --- diff --git a/python-certbot-dns-rfc2136-dnspython-115-compatibility.patch b/python-certbot-dns-rfc2136-dnspython-115-compatibility.patch new file mode 100644 index 0000000..9ff5845 --- /dev/null +++ b/python-certbot-dns-rfc2136-dnspython-115-compatibility.patch @@ -0,0 +1,38 @@ +From 3ab541b9a97d2ed8987a34ceba3a660cb90e5eae Mon Sep 17 00:00:00 2001 +From: Alex Zorin +Date: Mon, 13 Sep 2021 07:03:13 +1000 +Subject: [PATCH] dns-rfc2136: use certbot's own is_ipaddress func + +--- + .../certbot_dns_rfc2136/_internal/dns_rfc2136.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/certbot-dns-rfc2136/certbot_dns_rfc2136/_internal/dns_rfc2136.py b/certbot-dns-rfc2136/certbot_dns_rfc2136/_internal/dns_rfc2136.py +index 9fa68c9d98..98687e6abc 100644 +--- a/certbot-dns-rfc2136/certbot_dns_rfc2136/_internal/dns_rfc2136.py ++++ b/certbot-dns-rfc2136/certbot_dns_rfc2136/_internal/dns_rfc2136.py +@@ -3,7 +3,6 @@ + from typing import Optional + + import dns.flags +-from dns.inet import is_address + import dns.message + import dns.name + import dns.query +@@ -16,6 +15,7 @@ + from certbot import errors + from certbot.plugins import dns_common + from certbot.plugins.dns_common import CredentialsConfiguration ++from certbot.util import is_ipaddress + + logger = logging.getLogger(__name__) + +@@ -57,7 +57,7 @@ def more_info(self): # pylint: disable=missing-function-docstring + + def _validate_credentials(self, credentials): + server = credentials.conf('server') +- if not is_address(server): ++ if not is_ipaddress(server): + raise errors.PluginError("The configured target DNS server ({0}) is not a valid IPv4 " + "or IPv6 address. A hostname is not allowed.".format(server)) + algorithm = credentials.conf('algorithm') diff --git a/python-certbot-dns-rfc2136.spec b/python-certbot-dns-rfc2136.spec index 642c171..f30b8cb 100644 --- a/python-certbot-dns-rfc2136.spec +++ b/python-certbot-dns-rfc2136.spec @@ -14,6 +14,12 @@ URL: https://github.com/certbot/certbot Source0: %{pypi_source} Source1: %{pypi_source}.asc Source2: https://dl.eff.org/certbot.pub +# restore compatibility with dnspython 1.15 (as present in RHEL 8) +# Patch is part of upstream PR 9035: +# https://github.com/certbot/certbot/pull/9035 +# +# see also: https://github.com/certbot/certbot/issues/9033 +Patch1: %{name}-dnspython-115-compatibility.patch BuildArch: noarch @@ -54,7 +60,7 @@ This is the Python 3 version of the package. %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' -%autosetup -n %{pypi_name}-%{version} +%autosetup -n %{pypi_name}-%{version} -p2 # Remove bundled egg-info rm -rf %{pypi_name}.egg-info