3002, patch for _scope_id error.

e9
Gwyn Ciesla 4 years ago
parent 1d10613476
commit 7b0d1df0c7

1
.gitignore vendored

@ -90,3 +90,4 @@
/salt-3001rc1.tar.gz
/salt-3001.tar.gz
/salt-3001.1.tar.gz
/salt-3002.tar.gz

@ -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)

@ -15,7 +15,7 @@
%define fish_dir %{_datadir}/fish/vendor_functions.d
Name: salt
Version: 3001.1%{?__rc_ver}
Version: 3002%{?__rc_ver}
Release: 1%{?dist}
Summary: A parallel remote execution system
Group: System Environment/Daemons
@ -44,6 +44,8 @@ Source19: salt-minion.fish
Source20: salt-run.fish
Source21: salt-syndic.fish
Patch0: 4c5e18bfd092d9003d12c89131f787a57d54cf38.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@ -178,6 +180,8 @@ Supports Python 3.
%setup -q -c
cd %{name}-%{version}
%patch0 -p1
rm -rf %{py3dir}
cp -a . %{py3dir}
@ -453,6 +457,10 @@ rm -rf %{buildroot}
%changelog
* Sun Oct 25 2020 Gwyn Ciesla <gwync@protonmail.com> - 3002-1
- 3002
- Patch for _scope_id 3.9 error.
* Mon Jul 27 2020 SaltStack Packaging Team <packaging@saltstack.com> - 3001.1-1
- Update to feature release 3001.1-1 for Python 3

@ -1 +1 @@
SHA512 (salt-3001.1.tar.gz) = d59b6c3580d3379192f36e462385c74b53b0b385e63b3db7734003d0a71df8f88593a59eeccd86b1dc15800e46d050094e7a88f2636673770ddc952d0110ca29
SHA512 (salt-3002.tar.gz) = 7a3ed78b301e9c1ef65c8e6aeeaebc2376b3942e94e38b0591860fa1d9213c6c0f85db4d932b4c7c9d20717027a686690973d0dfd2aff17f44abae0ec0e97d31

Loading…
Cancel
Save