1 |
commit: 912520578b89e0d26c486784807c25e13f74d55f |
2 |
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com> |
3 |
AuthorDate: Thu Apr 30 02:11:32 2020 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 30 05:24:06 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91252057 |
7 |
|
8 |
app-admin/salt-3000.2-r2: revbump, add py38 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/718188 |
11 |
Copyright: Sony Interactive Entertainment Inc. |
12 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
13 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
14 |
|
15 |
app-admin/salt/files/salt-3000.2-py38-abc.patch | 79 ++++ |
16 |
app-admin/salt/files/salt-3000.2-py38-misc.patch | 460 +++++++++++++++++++++ |
17 |
app-admin/salt/files/salt-3000.2-py38.patch | 60 +++ |
18 |
...salt-3000.2-r1.ebuild => salt-3000.2-r2.ebuild} | 12 +- |
19 |
4 files changed, 609 insertions(+), 2 deletions(-) |
20 |
|
21 |
diff --git a/app-admin/salt/files/salt-3000.2-py38-abc.patch b/app-admin/salt/files/salt-3000.2-py38-abc.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..e9f64b66417 |
24 |
--- /dev/null |
25 |
+++ b/app-admin/salt/files/salt-3000.2-py38-abc.patch |
26 |
@@ -0,0 +1,79 @@ |
27 |
+From 11c23a526ae926ca082ee7ad92246e085c51b8e6 Mon Sep 17 00:00:00 2001 |
28 |
+From: =?UTF-8?q?S=C3=A9bastien=20Blaisot?= <sebastien@×××××××.org> |
29 |
+Date: Fri, 17 Jan 2020 17:06:42 +0100 |
30 |
+Subject: [PATCH] Import abstract base classes from collection.abc in python |
31 |
+ 3.3+ |
32 |
+ |
33 |
+--- |
34 |
+ salt/modules/file.py | 6 +++++- |
35 |
+ salt/modules/win_file.py | 5 ++++- |
36 |
+ salt/states/file.py | 6 +++++- |
37 |
+ salt/utils/dictdiffer.py | 5 ++++- |
38 |
+ 4 files changed, 18 insertions(+), 4 deletions(-) |
39 |
+ |
40 |
+diff --git a/salt/modules/file.py b/salt/modules/file.py |
41 |
+index 771b204d63fe..d1ec5e4c295d 100644 |
42 |
+--- a/salt/modules/file.py |
43 |
++++ b/salt/modules/file.py |
44 |
+@@ -29,7 +29,11 @@ |
45 |
+ import glob |
46 |
+ import hashlib |
47 |
+ import mmap |
48 |
+-from collections import Iterable, Mapping, namedtuple |
49 |
++try: |
50 |
++ from collections.abc import Iterable, Mapping |
51 |
++except ImportError: |
52 |
++ from collections import Iterable, Mapping |
53 |
++from collections import namedtuple |
54 |
+ from functools import reduce # pylint: disable=redefined-builtin |
55 |
+ |
56 |
+ # pylint: disable=import-error,no-name-in-module,redefined-builtin |
57 |
+diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py |
58 |
+index 4fd3eebcdd81..5bc983786a98 100644 |
59 |
+--- a/salt/modules/win_file.py |
60 |
++++ b/salt/modules/win_file.py |
61 |
+@@ -17,7 +17,10 @@ |
62 |
+ import logging |
63 |
+ # pylint: disable=W0611 |
64 |
+ import operator # do not remove |
65 |
+-from collections import Iterable, Mapping # do not remove |
66 |
++try: |
67 |
++ from collections.abc import Iterable, Mapping # do not remove |
68 |
++except ImportError: |
69 |
++ from collections import Iterable, Mapping # do not remove |
70 |
+ from functools import reduce # do not remove |
71 |
+ import datetime # do not remove. |
72 |
+ import tempfile # do not remove. Used in salt.modules.file.__clean_tmp |
73 |
+diff --git a/salt/states/file.py b/salt/states/file.py |
74 |
+index 23c3d3c53955..36231c69cff6 100644 |
75 |
+--- a/salt/states/file.py |
76 |
++++ b/salt/states/file.py |
77 |
+@@ -291,7 +291,11 @@ def run(): |
78 |
+ import sys |
79 |
+ import time |
80 |
+ import traceback |
81 |
+-from collections import Iterable, Mapping, defaultdict |
82 |
++try: |
83 |
++ from collections.abc import Iterable, Mapping |
84 |
++except ImportError: |
85 |
++ from collections import Iterable, Mapping |
86 |
++from collections import defaultdict |
87 |
+ from datetime import datetime, date # python3 problem in the making? |
88 |
+ |
89 |
+ # Import salt libs |
90 |
+diff --git a/salt/utils/dictdiffer.py b/salt/utils/dictdiffer.py |
91 |
+index 30e87e885436..da6bd5ed944c 100644 |
92 |
+--- a/salt/utils/dictdiffer.py |
93 |
++++ b/salt/utils/dictdiffer.py |
94 |
+@@ -13,7 +13,10 @@ |
95 |
+ ''' |
96 |
+ from __future__ import absolute_import, print_function, unicode_literals |
97 |
+ import copy |
98 |
+-from collections import Mapping |
99 |
++try: |
100 |
++ from collections.abc import Mapping |
101 |
++except ImportError: |
102 |
++ from collections import Mapping |
103 |
+ from salt.ext import six |
104 |
+ |
105 |
+ |
106 |
|
107 |
diff --git a/app-admin/salt/files/salt-3000.2-py38-misc.patch b/app-admin/salt/files/salt-3000.2-py38-misc.patch |
108 |
new file mode 100644 |
109 |
index 00000000000..93cc045a531 |
110 |
--- /dev/null |
111 |
+++ b/app-admin/salt/files/salt-3000.2-py38-misc.patch |
112 |
@@ -0,0 +1,460 @@ |
113 |
+diff --git a/salt/config/__init__.py b/salt/config/__init__.py |
114 |
+index 70b34ec949..4304d99bf7 100644 |
115 |
+--- a/salt/config/__init__.py |
116 |
++++ b/salt/config/__init__.py |
117 |
+@@ -8,6 +8,7 @@ from __future__ import absolute_import, print_function, unicode_literals, genera |
118 |
+ import os |
119 |
+ import re |
120 |
+ import sys |
121 |
++import copy |
122 |
+ import glob |
123 |
+ import time |
124 |
+ import codecs |
125 |
+@@ -3191,7 +3192,7 @@ def apply_cloud_providers_config(overrides, defaults=None): |
126 |
+ # Merge provided extends |
127 |
+ keep_looping = False |
128 |
+ for alias, entries in six.iteritems(providers.copy()): |
129 |
+- for driver, details in six.iteritems(entries): |
130 |
++ for driver, details in copy.copy(entries).items(): |
131 |
+ |
132 |
+ if 'extends' not in details: |
133 |
+ # Extends resolved or non existing, continue! |
134 |
+diff --git a/salt/grains/core.py b/salt/grains/core.py |
135 |
+index 9b244def9c..ede3a94de9 100644 |
136 |
+--- a/salt/grains/core.py |
137 |
++++ b/salt/grains/core.py |
138 |
+@@ -1939,7 +1939,7 @@ def os_data(): |
139 |
+ ) |
140 |
+ (osname, osrelease, oscodename) = \ |
141 |
+ [x.strip('"').strip("'") for x in |
142 |
+- linux_distribution(supported_dists=_supported_dists)] |
143 |
++ linux_distribution()] |
144 |
+ # Try to assign these three names based on the lsb info, they tend to |
145 |
+ # be more accurate than what python gets from /etc/DISTRO-release. |
146 |
+ # It's worth noting that Ubuntu has patched their Python distribution |
147 |
+diff --git a/salt/modules/boto_route53.py b/salt/modules/boto_route53.py |
148 |
+index a663ec7207..8d3d8c2105 100644 |
149 |
+--- a/salt/modules/boto_route53.py |
150 |
++++ b/salt/modules/boto_route53.py |
151 |
+@@ -158,7 +158,7 @@ def describe_hosted_zones(zone_id=None, domain_name=None, region=None, |
152 |
+ else: |
153 |
+ marker = None |
154 |
+ ret = None |
155 |
+- while marker is not '': |
156 |
++ while marker != '': |
157 |
+ r = conn.get_all_hosted_zones(start_marker=marker, |
158 |
+ zone_list=ret) |
159 |
+ ret = r['ListHostedZonesResponse']['HostedZones'] |
160 |
+diff --git a/salt/modules/file.py b/salt/modules/file.py |
161 |
+index b5b70e2d4c..41a9229eb4 100644 |
162 |
+--- a/salt/modules/file.py |
163 |
++++ b/salt/modules/file.py |
164 |
+@@ -2744,7 +2744,7 @@ def blockreplace(path, |
165 |
+ |
166 |
+ if block_found: |
167 |
+ diff = __utils__['stringutils.get_diff'](orig_file, new_file) |
168 |
+- has_changes = diff is not '' |
169 |
++ has_changes = diff != '' |
170 |
+ if has_changes and not dry_run: |
171 |
+ # changes detected |
172 |
+ # backup file attrs |
173 |
+diff --git a/salt/modules/iptables.py b/salt/modules/iptables.py |
174 |
+index e232c6931f..9708f45256 100644 |
175 |
+--- a/salt/modules/iptables.py |
176 |
++++ b/salt/modules/iptables.py |
177 |
+@@ -905,7 +905,7 @@ def insert(table='filter', chain=None, position=None, rule=None, family='ipv4'): |
178 |
+ rules = get_rules(family=family) |
179 |
+ size = len(rules[table][chain]['rules']) |
180 |
+ position = (size + position) + 1 |
181 |
+- if position is 0: |
182 |
++ if position == 0: |
183 |
+ position = 1 |
184 |
+ |
185 |
+ wait = '--wait' if _has_option('--wait', family) else '' |
186 |
+@@ -1040,7 +1040,7 @@ def _parse_conf(conf_file=None, in_mem=False, family='ipv4'): |
187 |
+ ret_args = {} |
188 |
+ chain = parsed_args['append'] |
189 |
+ for arg in parsed_args: |
190 |
+- if parsed_args[arg] and arg is not 'append': |
191 |
++ if parsed_args[arg] and arg != 'append': |
192 |
+ ret_args[arg] = parsed_args[arg] |
193 |
+ if parsed_args['comment'] is not None: |
194 |
+ comment = parsed_args['comment'][0].strip('"') |
195 |
+diff --git a/salt/modules/lxd.py b/salt/modules/lxd.py |
196 |
+index d6c2d8d4b9..d617cbb3df 100644 |
197 |
+--- a/salt/modules/lxd.py |
198 |
++++ b/salt/modules/lxd.py |
199 |
+@@ -1824,11 +1824,11 @@ def container_file_get(name, src, dst, overwrite=False, |
200 |
+ |
201 |
+ if mode: |
202 |
+ os.chmod(dst, mode) |
203 |
+- if uid or uid is '0': |
204 |
++ if uid or uid == '0': |
205 |
+ uid = int(uid) |
206 |
+ else: |
207 |
+ uid = -1 |
208 |
+- if gid or gid is '0': |
209 |
++ if gid or gid == '0': |
210 |
+ gid = int(gid) |
211 |
+ else: |
212 |
+ gid = -1 |
213 |
+diff --git a/salt/modules/mongodb.py b/salt/modules/mongodb.py |
214 |
+index 8cdb819102..ed3228150e 100644 |
215 |
+--- a/salt/modules/mongodb.py |
216 |
++++ b/salt/modules/mongodb.py |
217 |
+@@ -484,7 +484,7 @@ def update_one(objects, collection, user=None, password=None, host=None, port=No |
218 |
+ objects = six.text_type(objects) |
219 |
+ objs = re.split(r'}\s+{', objects) |
220 |
+ |
221 |
+- if len(objs) is not 2: |
222 |
++ if len(objs) != 2: |
223 |
+ return "Your request does not contain a valid " + \ |
224 |
+ "'{_\"id\": \"my_id\"} {\"my_doc\": \"my_val\"}'" |
225 |
+ |
226 |
+diff --git a/salt/modules/virt.py b/salt/modules/virt.py |
227 |
+index a2412bb745..91e105fe04 100644 |
228 |
+--- a/salt/modules/virt.py |
229 |
++++ b/salt/modules/virt.py |
230 |
+@@ -4732,7 +4732,7 @@ def _parse_pools_caps(doc): |
231 |
+ if options: |
232 |
+ if 'options' not in pool_caps: |
233 |
+ pool_caps['options'] = {} |
234 |
+- kind = option_kind if option_kind is not 'vol' else 'volume' |
235 |
++ kind = option_kind if option_kind != 'vol' else 'volume' |
236 |
+ pool_caps['options'][kind] = options |
237 |
+ return pool_caps |
238 |
+ |
239 |
+diff --git a/salt/modules/win_ip.py b/salt/modules/win_ip.py |
240 |
+index e69f44211e..99b9d392f6 100644 |
241 |
+--- a/salt/modules/win_ip.py |
242 |
++++ b/salt/modules/win_ip.py |
243 |
+@@ -342,7 +342,7 @@ def set_static_dns(iface, *addrs): |
244 |
+ salt -G 'os_family:Windows' ip.set_static_dns 'Local Area Connection' '192.168.1.1' |
245 |
+ salt -G 'os_family:Windows' ip.set_static_dns 'Local Area Connection' '192.168.1.252' '192.168.1.253' |
246 |
+ ''' |
247 |
+- if addrs is () or str(addrs[0]).lower() == 'none': |
248 |
++ if addrs == () or str(addrs[0]).lower() == 'none': |
249 |
+ return {'Interface': iface, 'DNS Server': 'No Changes'} |
250 |
+ # Clear the list of DNS servers if [] is passed |
251 |
+ if str(addrs[0]).lower() == '[]': |
252 |
+diff --git a/salt/modules/win_lgpo.py b/salt/modules/win_lgpo.py |
253 |
+index efa154889f..50f0c9940f 100644 |
254 |
+--- a/salt/modules/win_lgpo.py |
255 |
++++ b/salt/modules/win_lgpo.py |
256 |
+@@ -4692,7 +4692,7 @@ class _policy_info(object): |
257 |
+ return 'true' |
258 |
+ elif val.upper() == 'Run Windows PowerShell scripts last'.upper(): |
259 |
+ return 'false' |
260 |
+- elif val is 'Not Configured': |
261 |
++ elif val == 'Not Configured': |
262 |
+ return None |
263 |
+ else: |
264 |
+ return 'Invalid Value' |
265 |
+diff --git a/salt/modules/win_system.py b/salt/modules/win_system.py |
266 |
+index 74fa61bc51..42f0c2ca6e 100644 |
267 |
+--- a/salt/modules/win_system.py |
268 |
++++ b/salt/modules/win_system.py |
269 |
+@@ -1149,7 +1149,7 @@ def set_system_date_time(years=None, |
270 |
+ system_time.wSecond = int(seconds) |
271 |
+ system_time_ptr = ctypes.pointer(system_time) |
272 |
+ succeeded = ctypes.windll.kernel32.SetLocalTime(system_time_ptr) |
273 |
+- if succeeded is not 0: |
274 |
++ if succeeded != 0: |
275 |
+ return True |
276 |
+ else: |
277 |
+ log.error('Failed to set local time') |
278 |
+diff --git a/salt/modules/x509.py b/salt/modules/x509.py |
279 |
+index 1cdd912bfb..4069076c32 100644 |
280 |
+--- a/salt/modules/x509.py |
281 |
++++ b/salt/modules/x509.py |
282 |
+@@ -131,7 +131,7 @@ def _new_extension(name, value, critical=0, issuer=None, _pyfree=1): |
283 |
+ to create the authoritykeyidentifier extension. |
284 |
+ ''' |
285 |
+ if name == 'subjectKeyIdentifier' and \ |
286 |
+- value.strip('0123456789abcdefABCDEF:') is not '': |
287 |
++ value.strip('0123456789abcdefABCDEF:') != '': |
288 |
+ raise salt.exceptions.SaltInvocationError( |
289 |
+ 'value must be precomputed hash') |
290 |
+ |
291 |
+diff --git a/salt/output/highstate.py b/salt/output/highstate.py |
292 |
+index 1f2f9452fa..87be7656fe 100644 |
293 |
+--- a/salt/output/highstate.py |
294 |
++++ b/salt/output/highstate.py |
295 |
+@@ -209,7 +209,7 @@ def _format_host(host, data, indent_level=1): |
296 |
+ # Verify that the needed data is present |
297 |
+ data_tmp = {} |
298 |
+ for tname, info in six.iteritems(data): |
299 |
+- if isinstance(info, dict) and tname is not 'changes' and info and '__run_num__' not in info: |
300 |
++ if isinstance(info, dict) and tname != 'changes' and info and '__run_num__' not in info: |
301 |
+ err = ('The State execution failed to record the order ' |
302 |
+ 'in which all states were executed. The state ' |
303 |
+ 'return missing data is:') |
304 |
+diff --git a/salt/renderers/stateconf.py b/salt/renderers/stateconf.py |
305 |
+index cfce9e6926..1b116ddfb1 100644 |
306 |
+--- a/salt/renderers/stateconf.py |
307 |
++++ b/salt/renderers/stateconf.py |
308 |
+@@ -224,7 +224,7 @@ def render(input, saltenv='base', sls='', argline='', **kws): |
309 |
+ tmplctx = STATE_CONF.copy() |
310 |
+ if tmplctx: |
311 |
+ prefix = sls + '::' |
312 |
+- for k in six.iterkeys(tmplctx): # iterate over a copy of keys |
313 |
++ for k in copy.copy(tmplctx).keys(): # iterate over a copy of keys |
314 |
+ if k.startswith(prefix): |
315 |
+ tmplctx[k[len(prefix):]] = tmplctx[k] |
316 |
+ del tmplctx[k] |
317 |
+diff --git a/salt/returners/slack_webhook_return.py b/salt/returners/slack_webhook_return.py |
318 |
+index aad1cdf656..0db705df01 100644 |
319 |
+--- a/salt/returners/slack_webhook_return.py |
320 |
++++ b/salt/returners/slack_webhook_return.py |
321 |
+@@ -322,7 +322,7 @@ def returner(ret): |
322 |
+ show_tasks = _options.get('show_tasks') |
323 |
+ author_icon = _options.get('author_icon') |
324 |
+ |
325 |
+- if not webhook or webhook is '': |
326 |
++ if not webhook or webhook == '': |
327 |
+ log.error('%s.webhook not defined in salt config', __virtualname__) |
328 |
+ return |
329 |
+ |
330 |
+diff --git a/salt/states/debconfmod.py b/salt/states/debconfmod.py |
331 |
+index a0ef20b185..a7478c7ac0 100644 |
332 |
+--- a/salt/states/debconfmod.py |
333 |
++++ b/salt/states/debconfmod.py |
334 |
+@@ -210,7 +210,7 @@ def set(name, data, **kwargs): |
335 |
+ args['value'] = 'true' if args['value'] else 'false' |
336 |
+ |
337 |
+ if current is not None and [key, args['type'], six.text_type(args['value'])] in current: |
338 |
+- if ret['comment'] is '': |
339 |
++ if ret['comment'] == '': |
340 |
+ ret['comment'] = 'Unchanged answers: ' |
341 |
+ ret['comment'] += ('{0} ').format(key) |
342 |
+ else: |
343 |
+diff --git a/salt/states/git.py b/salt/states/git.py |
344 |
+index ce6455ee71..f2bf4da629 100644 |
345 |
+--- a/salt/states/git.py |
346 |
++++ b/salt/states/git.py |
347 |
+@@ -2464,7 +2464,7 @@ def detached(name, |
348 |
+ password, |
349 |
+ output_encoding=output_encoding)[0] |
350 |
+ |
351 |
+- if remote_rev_type is 'hash': |
352 |
++ if remote_rev_type == 'hash': |
353 |
+ try: |
354 |
+ __salt__['git.describe'](target, |
355 |
+ rev, |
356 |
+@@ -2643,7 +2643,7 @@ def detached(name, |
357 |
+ |
358 |
+ # get refs and checkout |
359 |
+ checkout_commit_id = '' |
360 |
+- if remote_rev_type is 'hash': |
361 |
++ if remote_rev_type == 'hash': |
362 |
+ if __salt__['git.describe']( |
363 |
+ target, |
364 |
+ rev, |
365 |
+diff --git a/salt/states/mysql_grants.py b/salt/states/mysql_grants.py |
366 |
+index d6023bbf86..638e988e13 100644 |
367 |
+--- a/salt/states/mysql_grants.py |
368 |
++++ b/salt/states/mysql_grants.py |
369 |
+@@ -167,7 +167,7 @@ def present(name, |
370 |
+ db_part = database.rpartition('.') |
371 |
+ my_db = db_part[0] |
372 |
+ my_table = db_part[2] |
373 |
+- my_db = __salt__['mysql.quote_identifier'](my_db, (my_table is '*')) |
374 |
++ my_db = __salt__['mysql.quote_identifier'](my_db, (my_table == '*')) |
375 |
+ my_table = __salt__['mysql.quote_identifier'](my_table) |
376 |
+ # Removing per table grants in case of database level grant !!! |
377 |
+ if token_grants['database'] == my_db: |
378 |
+diff --git a/salt/utils/args.py b/salt/utils/args.py |
379 |
+index 8cc0f35196..8caaae4d1f 100644 |
380 |
+--- a/salt/utils/args.py |
381 |
++++ b/salt/utils/args.py |
382 |
+@@ -253,6 +253,9 @@ def get_function_argspec(func, is_class_method=None): |
383 |
+ if not callable(func): |
384 |
+ raise TypeError('{0} is not a callable'.format(func)) |
385 |
+ |
386 |
++ if hasattr(func, "__wrapped__"): |
387 |
++ func = func.__wrapped__ |
388 |
++ |
389 |
+ if six.PY2: |
390 |
+ if is_class_method is True: |
391 |
+ aspec = inspect.getargspec(func) |
392 |
+diff --git a/salt/utils/decorators/path.py b/salt/utils/decorators/path.py |
393 |
+index 4adacf0e4e..37c692355f 100644 |
394 |
+--- a/salt/utils/decorators/path.py |
395 |
++++ b/salt/utils/decorators/path.py |
396 |
+@@ -4,10 +4,11 @@ Decorators for salt.utils.path |
397 |
+ ''' |
398 |
+ from __future__ import absolute_import, print_function, unicode_literals |
399 |
+ |
400 |
++import functools |
401 |
++ |
402 |
+ # Import Salt libs |
403 |
+ import salt.utils.path |
404 |
+ from salt.exceptions import CommandNotFoundError |
405 |
+-from salt.utils.decorators.signature import identical_signature_wrapper |
406 |
+ |
407 |
+ |
408 |
+ def which(exe): |
409 |
+@@ -15,13 +16,14 @@ def which(exe): |
410 |
+ Decorator wrapper for salt.utils.path.which |
411 |
+ ''' |
412 |
+ def wrapper(function): |
413 |
++ @functools.wraps(function) |
414 |
+ def wrapped(*args, **kwargs): |
415 |
+ if salt.utils.path.which(exe) is None: |
416 |
+ raise CommandNotFoundError( |
417 |
+ 'The \'{0}\' binary was not found in $PATH.'.format(exe) |
418 |
+ ) |
419 |
+ return function(*args, **kwargs) |
420 |
+- return identical_signature_wrapper(function, wrapped) |
421 |
++ return wrapped |
422 |
+ return wrapper |
423 |
+ |
424 |
+ |
425 |
+@@ -30,6 +32,7 @@ def which_bin(exes): |
426 |
+ Decorator wrapper for salt.utils.path.which_bin |
427 |
+ ''' |
428 |
+ def wrapper(function): |
429 |
++ @functools.wraps(function) |
430 |
+ def wrapped(*args, **kwargs): |
431 |
+ if salt.utils.path.which_bin(exes) is None: |
432 |
+ raise CommandNotFoundError( |
433 |
+@@ -39,5 +42,5 @@ def which_bin(exes): |
434 |
+ ) |
435 |
+ ) |
436 |
+ return function(*args, **kwargs) |
437 |
+- return identical_signature_wrapper(function, wrapped) |
438 |
++ return wrapped |
439 |
+ return wrapper |
440 |
+diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py |
441 |
+index 474af442a1..69204a53d4 100644 |
442 |
+--- a/salt/utils/schedule.py |
443 |
++++ b/salt/utils/schedule.py |
444 |
+@@ -721,7 +721,7 @@ class Schedule(object): |
445 |
+ if argspec.keywords: |
446 |
+ # this function accepts **kwargs, pack in the publish data |
447 |
+ for key, val in six.iteritems(ret): |
448 |
+- if key is not 'kwargs': |
449 |
++ if key != 'kwargs': |
450 |
+ kwargs['__pub_{0}'.format(key)] = copy.deepcopy(val) |
451 |
+ |
452 |
+ # Only include these when running runner modules |
453 |
+diff --git a/salt/utils/win_pdh.py b/salt/utils/win_pdh.py |
454 |
+index 9921ee72da..7e9e368caf 100644 |
455 |
+--- a/salt/utils/win_pdh.py |
456 |
++++ b/salt/utils/win_pdh.py |
457 |
+@@ -164,7 +164,7 @@ class Counter(object): |
458 |
+ ''' |
459 |
+ path = win32pdh.MakeCounterPath( |
460 |
+ (None, obj, instance, None, instance_index, counter), 0) |
461 |
+- if win32pdh.ValidatePath(path) is 0: |
462 |
++ if win32pdh.ValidatePath(path) == 0: |
463 |
+ return Counter(path, obj, instance, instance_index, counter) |
464 |
+ raise CommandExecutionError('Invalid counter specified: {0}'.format(path)) |
465 |
+ |
466 |
+diff --git a/tests/integration/cloud/helpers/virtualbox.py b/tests/integration/cloud/helpers/virtualbox.py |
467 |
+index 668f15d82f..a6bc9dd2c3 100644 |
468 |
+--- a/tests/integration/cloud/helpers/virtualbox.py |
469 |
++++ b/tests/integration/cloud/helpers/virtualbox.py |
470 |
+@@ -74,7 +74,7 @@ class VirtualboxCloudTestCase(ShellCase): |
471 |
+ output.pop(0) |
472 |
+ else: |
473 |
+ break |
474 |
+- if len(output) is 0: |
475 |
++ if len(output) == 0: |
476 |
+ return dict() |
477 |
+ else: |
478 |
+ return salt.utils.json.loads(''.join(output)) |
479 |
+diff --git a/tests/integration/modules/test_mysql.py b/tests/integration/modules/test_mysql.py |
480 |
+index 7edb77cb94..197c4e65ae 100644 |
481 |
+--- a/tests/integration/modules/test_mysql.py |
482 |
++++ b/tests/integration/modules/test_mysql.py |
483 |
+@@ -519,7 +519,7 @@ class MysqlModuleDbTest(ModuleCase, SaltReturnAssertsMixin): |
484 |
+ ) |
485 |
+ expected = [] |
486 |
+ for tablename, engine in sorted(six.iteritems(tablenames)): |
487 |
+- if engine is 'MEMORY': |
488 |
++ if engine == 'MEMORY': |
489 |
+ expected.append([{ |
490 |
+ 'Table': dbname+'.'+tablename, |
491 |
+ 'Msg_text': ("The storage engine for the table doesn't" |
492 |
+@@ -544,7 +544,7 @@ class MysqlModuleDbTest(ModuleCase, SaltReturnAssertsMixin): |
493 |
+ ) |
494 |
+ expected = [] |
495 |
+ for tablename, engine in sorted(six.iteritems(tablenames)): |
496 |
+- if engine is 'MYISAM': |
497 |
++ if engine == 'MYISAM': |
498 |
+ expected.append([{ |
499 |
+ 'Table': dbname+'.'+tablename, |
500 |
+ 'Msg_text': 'OK', |
501 |
+@@ -570,14 +570,14 @@ class MysqlModuleDbTest(ModuleCase, SaltReturnAssertsMixin): |
502 |
+ |
503 |
+ expected = [] |
504 |
+ for tablename, engine in sorted(six.iteritems(tablenames)): |
505 |
+- if engine is 'MYISAM': |
506 |
++ if engine == 'MYISAM': |
507 |
+ expected.append([{ |
508 |
+ 'Table': dbname+'.'+tablename, |
509 |
+ 'Msg_text': 'OK', |
510 |
+ 'Msg_type': 'status', |
511 |
+ 'Op': 'optimize' |
512 |
+ }]) |
513 |
+- elif engine is 'InnoDB': |
514 |
++ elif engine == 'InnoDB': |
515 |
+ expected.append([{ |
516 |
+ 'Table': dbname+'.'+tablename, |
517 |
+ 'Msg_text': ("Table does not support optimize, " |
518 |
+@@ -591,7 +591,7 @@ class MysqlModuleDbTest(ModuleCase, SaltReturnAssertsMixin): |
519 |
+ 'Msg_type': 'status', |
520 |
+ 'Op': 'optimize' |
521 |
+ }]) |
522 |
+- elif engine is 'MEMORY': |
523 |
++ elif engine == 'MEMORY': |
524 |
+ expected.append([{ |
525 |
+ 'Table': dbname+'.'+tablename, |
526 |
+ 'Msg_text': ("The storage engine for the table doesn't" |
527 |
+diff --git a/tests/unit/modules/test_virt.py b/tests/unit/modules/test_virt.py |
528 |
+index 32f4302e5f..c49bd0bccc 100644 |
529 |
+--- a/tests/unit/modules/test_virt.py |
530 |
++++ b/tests/unit/modules/test_virt.py |
531 |
+@@ -9,6 +9,7 @@ virt execution module unit tests |
532 |
+ from __future__ import absolute_import, print_function, unicode_literals |
533 |
+ import os |
534 |
+ import re |
535 |
++import sys |
536 |
+ import datetime |
537 |
+ import shutil |
538 |
+ |
539 |
+@@ -1393,19 +1394,20 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): |
540 |
+ self.assertEqual('vnc', setxml.find('devices/graphics').get('type')) |
541 |
+ |
542 |
+ # Update with no diff case |
543 |
+- self.assertEqual({ |
544 |
+- 'definition': False, |
545 |
+- 'disk': {'attached': [], 'detached': []}, |
546 |
+- 'interface': {'attached': [], 'detached': []} |
547 |
+- }, virt.update('my vm', cpu=1, mem=1024, |
548 |
+- disk_profile='default', disks=[{'name': 'data', 'size': 2048}], |
549 |
+- nic_profile='myprofile', |
550 |
+- interfaces=[{'name': 'eth0', 'type': 'network', 'source': 'default', |
551 |
+- 'mac': '52:54:00:39:02:b1'}, |
552 |
+- {'name': 'eth1', 'type': 'network', 'source': 'oldnet', |
553 |
+- 'mac': '52:54:00:39:02:b2'}], |
554 |
+- graphics={'type': 'spice', |
555 |
+- 'listen': {'type': 'address', 'address': '127.0.0.1'}})) |
556 |
++ if sys.hexversion < 0x03080000: |
557 |
++ self.assertEqual({ |
558 |
++ 'definition': False, |
559 |
++ 'disk': {'attached': [], 'detached': []}, |
560 |
++ 'interface': {'attached': [], 'detached': []} |
561 |
++ }, virt.update('my vm', cpu=1, mem=1024, |
562 |
++ disk_profile='default', disks=[{'name': 'data', 'size': 2048}], |
563 |
++ nic_profile='myprofile', |
564 |
++ interfaces=[{'name': 'eth0', 'type': 'network', 'source': 'default', |
565 |
++ 'mac': '52:54:00:39:02:b1'}, |
566 |
++ {'name': 'eth1', 'type': 'network', 'source': 'oldnet', |
567 |
++ 'mac': '52:54:00:39:02:b2'}], |
568 |
++ graphics={'type': 'spice', |
569 |
++ 'listen': {'type': 'address', 'address': '127.0.0.1'}})) |
570 |
+ |
571 |
+ # Failed XML description update case |
572 |
+ self.mock_conn.defineXML.side_effect = self.mock_libvirt.libvirtError("Test error") |
573 |
|
574 |
diff --git a/app-admin/salt/files/salt-3000.2-py38.patch b/app-admin/salt/files/salt-3000.2-py38.patch |
575 |
new file mode 100644 |
576 |
index 00000000000..1c543a085b1 |
577 |
--- /dev/null |
578 |
+++ b/app-admin/salt/files/salt-3000.2-py38.patch |
579 |
@@ -0,0 +1,60 @@ |
580 |
+From 5259ba8ef6e5949815641edc563deab67ba68582 Mon Sep 17 00:00:00 2001 |
581 |
+From: Mathias Fussenegger <f.mathias@××××××.net> |
582 |
+Date: Fri, 22 Nov 2019 17:05:27 +0100 |
583 |
+Subject: [PATCH] Remove _supported_dists import for python-3.8 support |
584 |
+ |
585 |
+`_supported_dists` has been removed from platform in Python 3.8: |
586 |
+ |
587 |
+ https://github.com/python/cpython/commit/8b94b41ab7b12f745dea744e8940631318816935#diff-47c8e5750258a08a6dd9de3e9c3774acL267-L271 |
588 |
+ |
589 |
+This instead inlines all the values that have been there. |
590 |
+ |
591 |
+Without this change running `salt-ssh` with Python 3.8 run into an |
592 |
+import error. |
593 |
+--- |
594 |
+ salt/grains/core.py | 31 +++++++++++++++++++++++++++---- |
595 |
+ 1 file changed, 27 insertions(+), 4 deletions(-) |
596 |
+ |
597 |
+diff --git a/salt/grains/core.py b/salt/grains/core.py |
598 |
+index 04c1ae91b5f5..77694abe84f9 100644 |
599 |
+--- a/salt/grains/core.py |
600 |
++++ b/salt/grains/core.py |
601 |
+@@ -35,11 +35,34 @@ |
602 |
+ __proxyenabled__ = ['*'] |
603 |
+ __FQDN__ = None |
604 |
+ |
605 |
+-# Extend the default list of supported distros. This will be used for the |
606 |
++# Default list of supported distros. This will be used for the |
607 |
+ # /etc/DISTRO-release checking that is part of linux_distribution() |
608 |
+-from platform import _supported_dists |
609 |
+-_supported_dists += ('arch', 'mageia', 'meego', 'vmware', 'bluewhite64', |
610 |
+- 'slamd64', 'ovs', 'system', 'mint', 'oracle', 'void') |
611 |
++_supported_dists = ( |
612 |
++ 'SuSE', |
613 |
++ 'UnitedLinux', |
614 |
++ 'arch', |
615 |
++ 'bluewhite64', |
616 |
++ 'centos', |
617 |
++ 'debian', |
618 |
++ 'fedora', |
619 |
++ 'gentoo', |
620 |
++ 'mageia', |
621 |
++ 'mandrake', |
622 |
++ 'mandriva', |
623 |
++ 'meego', |
624 |
++ 'mint', |
625 |
++ 'oracle', |
626 |
++ 'ovs', |
627 |
++ 'redhat', |
628 |
++ 'rocks', |
629 |
++ 'slackware', |
630 |
++ 'slamd64', |
631 |
++ 'system', |
632 |
++ 'turbolinux', |
633 |
++ 'vmware', |
634 |
++ 'void', |
635 |
++ 'yellowdog', |
636 |
++) |
637 |
+ |
638 |
+ # linux_distribution deprecated in py3.7 |
639 |
+ try: |
640 |
|
641 |
diff --git a/app-admin/salt/salt-3000.2-r1.ebuild b/app-admin/salt/salt-3000.2-r2.ebuild |
642 |
similarity index 95% |
643 |
rename from app-admin/salt/salt-3000.2-r1.ebuild |
644 |
rename to app-admin/salt/salt-3000.2-r2.ebuild |
645 |
index 100dafe7754..2f37c30a24d 100644 |
646 |
--- a/app-admin/salt/salt-3000.2-r1.ebuild |
647 |
+++ b/app-admin/salt/salt-3000.2-r2.ebuild |
648 |
@@ -2,7 +2,7 @@ |
649 |
# Distributed under the terms of the GNU General Public License v2 |
650 |
|
651 |
EAPI=7 |
652 |
-PYTHON_COMPAT=( python3_7 ) |
653 |
+PYTHON_COMPAT=( python3_{7,8} ) |
654 |
DISTUTILS_USE_SETUPTOOLS=bdepend |
655 |
inherit systemd distutils-r1 |
656 |
|
657 |
@@ -103,6 +103,14 @@ PATCHES=( |
658 |
"${FILESDIR}/salt-2019.2.0-skip-tests-that-oom-machine.patch" |
659 |
"${FILESDIR}/salt-3000.1-tests.patch" |
660 |
"${FILESDIR}/salt-3000.2-tests.patch" |
661 |
+ |
662 |
+ # https://github.com/saltstack/salt/pull/55410 |
663 |
+ "${FILESDIR}/salt-3000.2-py38.patch" |
664 |
+ |
665 |
+ "${FILESDIR}/salt-3000.2-py38-misc.patch" |
666 |
+ |
667 |
+ # https://github.com/saltstack/salt/pull/55900 |
668 |
+ "${FILESDIR}/salt-3000.2-py38-abc.patch" |
669 |
) |
670 |
|
671 |
python_prepare() { |
672 |
@@ -157,7 +165,7 @@ python_test() { |
673 |
) |
674 |
} |
675 |
|
676 |
-pkg_postinst_disabled() { |
677 |
+pkg_postinst() { |
678 |
if use python_targets_python3_8; then |
679 |
if use nova; then |
680 |
ewarn "Salt's nova functionality will not work with python3.8 since" |