parent
1d10613476
commit
7b0d1df0c7
@ -0,0 +1,53 @@
|
||||
From 4c5e18bfd092d9003d12c89131f787a57d54cf38 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?=
|
||||
<frederic.pierret@qubes-os.org>
|
||||
Date: Tue, 15 Sep 2020 17:05:13 +0200
|
||||
Subject: [PATCH] IPv6AddressScoped: define self._scope_id for python3.9+
|
||||
compatibility
|
||||
|
||||
Example of trace:
|
||||
|
||||
Traceback (most recent call last):
|
||||
File "/var/tmp/.root_dd8a91_salt/salt-call", line 27, in <module>
|
||||
salt_call()
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/scripts.py", line 472, in salt_call
|
||||
client.run()
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/cli/call.py", line 48, in run
|
||||
caller = salt.cli.caller.Caller.factory(self.config)
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/cli/caller.py", line 64, in factory
|
||||
return ZeroMQCaller(opts, **kwargs)
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/cli/caller.py", line 329, in __init__
|
||||
super(ZeroMQCaller, self).__init__(opts)
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/cli/caller.py", line 89, in __init__
|
||||
self.minion = salt.minion.SMinion(opts)
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/minion.py", line 912, in __init__
|
||||
opts["grains"] = salt.loader.grains(opts)
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/loader.py", line 825, in grains
|
||||
ret = funcs[key]()
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/grains/core.py", line 2369, in ip_fqdn
|
||||
ret["ipv6"] = salt.utils.network.ip_addrs6(include_loopback=True)
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/utils/network.py", line 1353, in ip_addrs6
|
||||
return _ip_addrs(interface, include_loopback, interface_data, "inet6")
|
||||
File "/var/tmp/.root_dd8a91_salt/pyall/salt/utils/network.py", line 1333, in _ip_addrs
|
||||
ret.add(addr)
|
||||
File "/usr/lib64/python3.9/ipaddress.py", line 1920, in __hash__
|
||||
return hash((self._ip, self._scope_id))
|
||||
AttributeError: _scope_id
|
||||
---
|
||||
salt/_compat.py | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/salt/_compat.py b/salt/_compat.py
|
||||
index 491233b59e70..6882e43c0512 100644
|
||||
--- a/salt/_compat.py
|
||||
+++ b/salt/_compat.py
|
||||
@@ -162,6 +162,9 @@ def __init__(self, address):
|
||||
else:
|
||||
self.__scope = None
|
||||
|
||||
+ # For compatibility with python3.9 ipaddress
|
||||
+ self._scope_id = self.__scope
|
||||
+
|
||||
if sys.version_info.major == 2:
|
||||
ipaddress._BaseAddress.__init__(self, address)
|
||||
ipaddress._BaseV6.__init__(self, address)
|
@ -1 +1 @@
|
||||
SHA512 (salt-3001.1.tar.gz) = d59b6c3580d3379192f36e462385c74b53b0b385e63b3db7734003d0a71df8f88593a59eeccd86b1dc15800e46d050094e7a88f2636673770ddc952d0110ca29
|
||||
SHA512 (salt-3002.tar.gz) = 7a3ed78b301e9c1ef65c8e6aeeaebc2376b3942e94e38b0591860fa1d9213c6c0f85db4d932b4c7c9d20717027a686690973d0dfd2aff17f44abae0ec0e97d31
|
||||
|
Loading…
Reference in new issue