1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
From: Helmut Grohne <helmut@subdivi.de>
Date: Tue, 2 Jul 2024 13:53:11 +0200
Subject: ftbfs-ipv6
Bug-Debian: https://bugs.debian.org/1030297
Bug-Upstream: https://gitlab.com/tango-controls/pytango/-/issues/450
Last-Update: 2023-05-24
This patch is a stop-gap measure for pytango 9.3.6. As you can see in the
upstream bug discussion, cppTango and pytango have changed and it will not work
for newer releases. The underlying issue likely is on the cppTango side.
Fundamentally, an IPv6-only machine does not have any IPv4-addresses beyond
127.0.0.1 and resolving its hostname using A records does not yield an answer.
cppTango/pytango inconsistently deal with localhost and sometimes resolve it as
IPv6 and this protocol misatch can result in test failures, which is why it has
used an IPv4 address explicitly. We now change that to 127.0.0.1 (rather than
localhost) to consistently get an available IPv4 address. This time, it
practically works on Debian's buildds.
---
tango/test_context.py | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/tango/test_context.py b/tango/test_context.py
index 6eb5611..3c8ce09 100644
--- a/tango/test_context.py
+++ b/tango/test_context.py
@@ -221,16 +221,7 @@ def get_host_ip():
This is used to be useful because an explicit IP was required to get
tango events to work properly. Now remains for backwards compatibility.
"""
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- # Connecting to a UDP address doesn't send packets
- # Note: For some reason Python3 on macOS does not accept 0 as a port but
- # returns with an errno 49 instead. Therefore, just use port 80 which just
- # works as well.
- s.connect(("8.8.8.8", 80))
- # Get ip address
- ip = s.getsockname()[0]
- s.close()
- return ip
+ return "127.0.0.1"
def _device_class_from_field(field):
|