]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix broken dnspython version checks
authorMichał Kępień <michal@isc.org>
Mon, 14 Mar 2022 08:19:03 +0000 (09:19 +0100)
committerMichał Kępień <michal@isc.org>
Mon, 14 Mar 2022 08:19:03 +0000 (09:19 +0100)
The dns.query Python module has the send_tcp() method defined in both
dnspython 1.x and 2.x, so checking for the existence of that method to
determine the dnspython version available in the test environment does
not make any sense.  Fix by checking the dns.version.MAJOR integer
instead.

bin/tests/system/checkds/prereq.sh
bin/tests/system/timeouts/prereq.sh

index b3fa8a38107f8873e3baece8559da995913bc564..220469575bd659f1d9fb5b940d2243b0635dfe48 100644 (file)
@@ -16,7 +16,7 @@ SYSTEMTESTTOP=..
 
 if test -n "$PYTHON"
 then
-    if $PYTHON -c "from dns.query import send_tcp" 2> /dev/null
+    if [ "$($PYTHON -c "import dns.version; print(dns.version.MAJOR)" 2> /dev/null)" -ge 2 ]
     then
         :
     else
index b3fa8a38107f8873e3baece8559da995913bc564..220469575bd659f1d9fb5b940d2243b0635dfe48 100644 (file)
@@ -16,7 +16,7 @@ SYSTEMTESTTOP=..
 
 if test -n "$PYTHON"
 then
-    if $PYTHON -c "from dns.query import send_tcp" 2> /dev/null
+    if [ "$($PYTHON -c "import dns.version; print(dns.version.MAJOR)" 2> /dev/null)" -ge 2 ]
     then
         :
     else