1 |
commit: f799fa96b2c8dcf29ea8fadb860ca8df51d17192 |
2 |
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Mar 31 00:53:06 2022 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 31 01:28:07 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f799fa96 |
7 |
|
8 |
app-admin/salt: add 3004.1 |
9 |
|
10 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
11 |
|
12 |
app-admin/salt/Manifest | 1 + |
13 |
app-admin/salt/files/salt-3004.1-jinja-3.patch | 40 ++++ |
14 |
app-admin/salt/files/salt-3004.1-tests.patch | 291 +++++++++++++++++++++++++ |
15 |
app-admin/salt/salt-3004.1.ebuild | 204 +++++++++++++++++ |
16 |
4 files changed, 536 insertions(+) |
17 |
|
18 |
diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest |
19 |
index 74cedfb26638..3ee27efecc4d 100644 |
20 |
--- a/app-admin/salt/Manifest |
21 |
+++ b/app-admin/salt/Manifest |
22 |
@@ -5,3 +5,4 @@ DIST salt-3001.8.tar.gz 15740488 BLAKE2B 77875a670b81438280becd1f29b64fbc7663791 |
23 |
DIST salt-3002.7.tar.gz 15792124 BLAKE2B b4cb4a6d73c45f3c2183a7adfe8196bbc5788dce1995bd5c640cd9957bdfdba2e96deebaba927d6103fc50f4eaab86d51f4dd4594d25b7357db79ed67b39258e SHA512 c1e7bbcd39b5c2bef351bd74026346bf729839c4161f6eff8162620e9cb08a63073abeeb8af6bab635070386a883df494ef08cc07a84efa9aa7f2160b357a938 |
24 |
DIST salt-3003.3.tar.gz 16017984 BLAKE2B 9cd1e33a7b6dff4d3c6c5a87e1204f7f113b6190da8301061e26fcec178aba597a9e17ab60a54a67b52a895a9a8aef58bec70e9fdd8d8edc5a42945f6de21a58 SHA512 4fe50922833fce48fcc679adb16a0e1fe893531b2feb08b235a1461c58b8d9a72af2acd89fc0f712207fb0cd215d6b446e31a40001b46c43d0cc4ac827ce29e3 |
25 |
DIST salt-3003.tar.gz 15830910 BLAKE2B ea4f02eece951c3fb4fcc480d00f7b531ac549b2e23ff9a210b73f749f9ba83e0402e02a59028f41f94958d17512e417b7c1b7015e8ee3aeac55be9b1374fe6f SHA512 7f631466372f303c03f2852a5cfba1ee5c6ba1636a6fe1e1622e90d0b1376ef9f670aa1b4754f3d9c8c7fe1b99fe1b4c49e140dc86d90d157a1ec1e73ba43c38 |
26 |
+DIST salt-3004.1.tar.gz 17685649 BLAKE2B 64950cdc8420228f935d4a21fc20872da9ecf7c51b866ec3c59b46486b84a739b002acc44fa909eed93ce3dc6bedc9804df05d3d9ee5a9a13cd9d041ba70f876 SHA512 9353a8dc2a1c6e272318c6f35059236c5d78b6c8930f715275b701c12fca3be1fe930eb533f3f0c22933ba60967b0980300b922fe486cee9a62e6cdb568bdf91 |
27 |
|
28 |
diff --git a/app-admin/salt/files/salt-3004.1-jinja-3.patch b/app-admin/salt/files/salt-3004.1-jinja-3.patch |
29 |
new file mode 100644 |
30 |
index 000000000000..98f21bc35129 |
31 |
--- /dev/null |
32 |
+++ b/app-admin/salt/files/salt-3004.1-jinja-3.patch |
33 |
@@ -0,0 +1,40 @@ |
34 |
+diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py |
35 |
+index 0cb70bf64a..322c2f7f46 100644 |
36 |
+--- a/salt/utils/jinja.py |
37 |
++++ b/salt/utils/jinja.py |
38 |
+@@ -25,10 +25,11 @@ import salt.utils.json |
39 |
+ import salt.utils.stringutils |
40 |
+ import salt.utils.url |
41 |
+ import salt.utils.yaml |
42 |
+-from jinja2 import BaseLoader, Markup, TemplateNotFound, nodes |
43 |
++from jinja2 import BaseLoader, TemplateNotFound, nodes |
44 |
+ from jinja2.environment import TemplateModule |
45 |
+ from jinja2.exceptions import TemplateRuntimeError |
46 |
+ from jinja2.ext import Extension |
47 |
++from markupsafe import Markup |
48 |
+ from salt.exceptions import TemplateError |
49 |
+ from salt.utils.decorators.jinja import jinja_filter, jinja_global, jinja_test |
50 |
+ from salt.utils.odict import OrderedDict |
51 |
+@@ -706,7 +707,7 @@ def method_call(obj, f_name, *f_args, **f_kwargs): |
52 |
+ return getattr(obj, f_name, lambda *args, **kwargs: None)(*f_args, **f_kwargs) |
53 |
+ |
54 |
+ |
55 |
+-@××××××.contextfunction |
56 |
++@××××××.pass_context |
57 |
+ def show_full_context(ctx): |
58 |
+ return salt.utils.data.simple_types_filter( |
59 |
+ {key: value for key, value in ctx.items()} |
60 |
+diff --git a/tests/unit/utils/test_jinja.py b/tests/unit/utils/test_jinja.py |
61 |
+index 6502831aff..dec847364a 100644 |
62 |
+--- a/tests/unit/utils/test_jinja.py |
63 |
++++ b/tests/unit/utils/test_jinja.py |
64 |
+@@ -22,7 +22,8 @@ import salt.utils.files |
65 |
+ import salt.utils.json |
66 |
+ import salt.utils.stringutils |
67 |
+ import salt.utils.yaml |
68 |
+-from jinja2 import DictLoader, Environment, Markup, exceptions |
69 |
++from jinja2 import DictLoader, Environment, exceptions |
70 |
++from markupsafe import Markup |
71 |
+ from salt.exceptions import SaltRenderError |
72 |
+ from salt.utils.decorators.jinja import JinjaFilter |
73 |
+ from salt.utils.jinja import ( |
74 |
|
75 |
diff --git a/app-admin/salt/files/salt-3004.1-tests.patch b/app-admin/salt/files/salt-3004.1-tests.patch |
76 |
new file mode 100644 |
77 |
index 000000000000..3a36977246f2 |
78 |
--- /dev/null |
79 |
+++ b/app-admin/salt/files/salt-3004.1-tests.patch |
80 |
@@ -0,0 +1,291 @@ |
81 |
+diff --git a/tests/pytests/functional/fileserver/test_roots.py b/tests/pytests/functional/fileserver/test_roots.py |
82 |
+index c65efc8d52..9060fb61e2 100644 |
83 |
+--- a/tests/pytests/functional/fileserver/test_roots.py |
84 |
++++ b/tests/pytests/functional/fileserver/test_roots.py |
85 |
+@@ -15,6 +15,7 @@ def configure_loader_modules(base_env_state_tree_root_dir): |
86 |
+ return {roots: {"__opts__": opts}} |
87 |
+ |
88 |
+ |
89 |
++@×××××××××××.skip("needs network access") |
90 |
+ # nox -e pytest-zeromq-3.8(coverage=False) -- -vvv --run-slow --run-destructive tests\pytests\functional\fileserver\test_roots.py |
91 |
+ def test_symlink_list(base_env_state_tree_root_dir): |
92 |
+ with pytest.helpers.temp_file( |
93 |
+diff --git a/tests/pytests/functional/pillar/test_gpg.py b/tests/pytests/functional/pillar/test_gpg.py |
94 |
+index aaa4733f1d..b55cc9b4cf 100644 |
95 |
+--- a/tests/pytests/functional/pillar/test_gpg.py |
96 |
++++ b/tests/pytests/functional/pillar/test_gpg.py |
97 |
+@@ -203,7 +203,7 @@ def gpg_homedir(salt_master, pillar_state_tree): |
98 |
+ universal_newlines=True, |
99 |
+ ) |
100 |
+ ret = ProcessResult( |
101 |
+- exitcode=proc.returncode, |
102 |
++ returncode=proc.returncode, |
103 |
+ stdout=proc.stdout, |
104 |
+ stderr=proc.stderr, |
105 |
+ cmdline=proc.args, |
106 |
+@@ -220,7 +220,7 @@ def gpg_homedir(salt_master, pillar_state_tree): |
107 |
+ input=TEST_KEY, |
108 |
+ ) |
109 |
+ ret = ProcessResult( |
110 |
+- exitcode=proc.returncode, |
111 |
++ returncode=proc.returncode, |
112 |
+ stdout=proc.stdout, |
113 |
+ stderr=proc.stderr, |
114 |
+ cmdline=proc.args, |
115 |
+@@ -250,7 +250,7 @@ def gpg_homedir(salt_master, pillar_state_tree): |
116 |
+ input="KILLAGENT", |
117 |
+ ) |
118 |
+ ret = ProcessResult( |
119 |
+- exitcode=proc.returncode, |
120 |
++ returncode=proc.returncode, |
121 |
+ stdout=proc.stdout, |
122 |
+ stderr=proc.stderr, |
123 |
+ cmdline=proc.args, |
124 |
+diff --git a/tests/pytests/integration/cli/test_salt_proxy.py b/tests/pytests/integration/cli/test_salt_proxy.py |
125 |
+index c32c7e11e2..a9ee9fbd8d 100644 |
126 |
+--- a/tests/pytests/integration/cli/test_salt_proxy.py |
127 |
++++ b/tests/pytests/integration/cli/test_salt_proxy.py |
128 |
+@@ -40,6 +40,7 @@ def test_exit_status_no_proxyid(salt_master, proxy_minion_id): |
129 |
+ assert "error: salt-proxy requires --proxyid" in exc.value.stderr, exc.value |
130 |
+ |
131 |
+ |
132 |
++@×××××××××××.skip("Currently broken") |
133 |
+ @pytest.mark.skip_on_windows(reason="Windows does not do user checks") |
134 |
+ def test_exit_status_unknown_user(salt_master, proxy_minion_id): |
135 |
+ """ |
136 |
+@@ -66,7 +67,7 @@ def test_exit_status_unknown_argument(salt_master, proxy_minion_id): |
137 |
+ factory = salt_master.salt_proxy_minion_daemon(proxy_minion_id) |
138 |
+ factory.start("--unknown-argument", start_timeout=10, max_start_attempts=1) |
139 |
+ |
140 |
+- assert exc.value.exitcode == salt.defaults.exitcodes.EX_USAGE, exc.value |
141 |
++ assert exc.value.returncode == salt.defaults.exitcodes.EX_USAGE, exc.value |
142 |
+ assert "Usage" in exc.value.stderr, exc.value |
143 |
+ assert "no such option: --unknown-argument" in exc.value.stderr, exc.value |
144 |
+ |
145 |
+@@ -89,8 +90,8 @@ def test_exit_status_correct_usage(salt_master, proxy_minion_id, salt_cli): |
146 |
+ assert factory.is_running() |
147 |
+ # Let's issue a ping before terminating |
148 |
+ ret = salt_cli.run("test.ping", minion_tgt=proxy_minion_id) |
149 |
+- assert ret.exitcode == 0 |
150 |
++ assert ret.returncode == 0 |
151 |
+ assert ret.json is True |
152 |
+ # Terminate the proxy minion |
153 |
+ ret = factory.terminate() |
154 |
+- assert ret.exitcode == salt.defaults.exitcodes.EX_OK, ret |
155 |
++ assert ret.returncode == salt.defaults.exitcodes.EX_OK, ret |
156 |
+diff --git a/tests/pytests/integration/sdb/test_vault.py b/tests/pytests/integration/sdb/test_vault.py |
157 |
+index 7dc4c55417..6c48296a0c 100644 |
158 |
+--- a/tests/pytests/integration/sdb/test_vault.py |
159 |
++++ b/tests/pytests/integration/sdb/test_vault.py |
160 |
+@@ -107,7 +107,7 @@ def vault_container_version(request, salt_call_cli, vault_port): |
161 |
+ if proc.returncode == 0: |
162 |
+ break |
163 |
+ ret = ProcessResult( |
164 |
+- exitcode=proc.returncode, |
165 |
++ returncode=proc.returncode, |
166 |
+ stdout=proc.stdout, |
167 |
+ stderr=proc.stderr, |
168 |
+ cmdline=proc.args, |
169 |
+@@ -133,7 +133,7 @@ def vault_container_version(request, salt_call_cli, vault_port): |
170 |
+ ) |
171 |
+ if proc.returncode != 0: |
172 |
+ ret = ProcessResult( |
173 |
+- exitcode=proc.returncode, |
174 |
++ returncode=proc.returncode, |
175 |
+ stdout=proc.stdout, |
176 |
+ stderr=proc.stderr, |
177 |
+ cmdline=proc.args, |
178 |
+@@ -150,7 +150,7 @@ def vault_container_version(request, salt_call_cli, vault_port): |
179 |
+ universal_newlines=True, |
180 |
+ ) |
181 |
+ ret = ProcessResult( |
182 |
+- exitcode=proc.returncode, |
183 |
++ returncode=proc.returncode, |
184 |
+ stdout=proc.stdout, |
185 |
+ stderr=proc.stderr, |
186 |
+ cmdline=proc.args, |
187 |
+diff --git a/tests/pytests/unit/modules/test_cmdmod.py b/tests/pytests/unit/modules/test_cmdmod.py |
188 |
+index bc1d2818aa..3bd93862b7 100644 |
189 |
+--- a/tests/pytests/unit/modules/test_cmdmod.py |
190 |
++++ b/tests/pytests/unit/modules/test_cmdmod.py |
191 |
+@@ -440,6 +440,7 @@ def test_run_cwd_doesnt_exist_issue_7154(): |
192 |
+ cmdmod.run_all(cmd, cwd=cwd) |
193 |
+ |
194 |
+ |
195 |
++@×××××××××××.skip("needs root access") |
196 |
+ @pytest.mark.skip_on_darwin |
197 |
+ @pytest.mark.skip_on_windows |
198 |
+ def test_run_cwd_in_combination_with_runas(): |
199 |
+diff --git a/tests/pytests/unit/modules/test_portage_config.py b/tests/pytests/unit/modules/test_portage_config.py |
200 |
+index 5cc6b90596..db37d2c4f1 100644 |
201 |
+--- a/tests/pytests/unit/modules/test_portage_config.py |
202 |
++++ b/tests/pytests/unit/modules/test_portage_config.py |
203 |
+@@ -29,6 +29,7 @@ def test_get_config_file_wildcards(): |
204 |
+ assert portage_config._get_config_file("mask", atom) == expected |
205 |
+ |
206 |
+ |
207 |
++@×××××××××××.skip("test needs root access") |
208 |
+ def test_enforce_nice_config(tmp_path): |
209 |
+ atoms = [ |
210 |
+ ("*/*::repo", "repo"), |
211 |
+diff --git a/tests/pytests/unit/state/test_state_compiler.py b/tests/pytests/unit/state/test_state_compiler.py |
212 |
+index fc43cf154d..7aa511c9f7 100644 |
213 |
+--- a/tests/pytests/unit/state/test_state_compiler.py |
214 |
++++ b/tests/pytests/unit/state/test_state_compiler.py |
215 |
+@@ -679,6 +679,7 @@ def test_verify_retry_parsing(): |
216 |
+ assert set(expected_result).issubset(set(state_obj.call(low_data))) |
217 |
+ |
218 |
+ |
219 |
++@×××××××××××.skip("test requires root access") |
220 |
+ def test_render_requisite_require_disabled(): |
221 |
+ """ |
222 |
+ Test that the state compiler correctly deliver a rendering |
223 |
+@@ -719,6 +720,7 @@ def test_render_requisite_require_disabled(): |
224 |
+ assert run_num == 0 |
225 |
+ |
226 |
+ |
227 |
++@×××××××××××.skip("test requires root access") |
228 |
+ def test_render_requisite_require_in_disabled(): |
229 |
+ """ |
230 |
+ Test that the state compiler correctly deliver a rendering |
231 |
+diff --git a/tests/pytests/unit/state/test_state_format_slots.py b/tests/pytests/unit/state/test_state_format_slots.py |
232 |
+index 57b7bb2b87..7d2abce8d0 100644 |
233 |
+--- a/tests/pytests/unit/state/test_state_format_slots.py |
234 |
++++ b/tests/pytests/unit/state/test_state_format_slots.py |
235 |
+@@ -218,6 +218,7 @@ def test_slot_append(state_obj): |
236 |
+ assert cdata == {"args": ["arg"], "kwargs": {"key": "value1thing~"}} |
237 |
+ |
238 |
+ |
239 |
++@×××××××××××.skip("test needs root") |
240 |
+ # Skip on windows like integration.modules.test_state.StateModuleTest.test_parallel_state_with_long_tag |
241 |
+ @skipIf( |
242 |
+ salt.utils.platform.is_windows(), |
243 |
+diff --git a/tests/pytests/unit/test_minion.py b/tests/pytests/unit/test_minion.py |
244 |
+index 985ec99276..eb8a476e30 100644 |
245 |
+--- a/tests/pytests/unit/test_minion.py |
246 |
++++ b/tests/pytests/unit/test_minion.py |
247 |
+@@ -493,6 +493,7 @@ def test_scheduler_before_connect(): |
248 |
+ minion.destroy() |
249 |
+ |
250 |
+ |
251 |
++@×××××××××××.skip("test needs root access") |
252 |
+ def test_minion_module_refresh(): |
253 |
+ """ |
254 |
+ Tests that the 'module_refresh' just return in case there is no 'schedule' |
255 |
+@@ -520,6 +521,7 @@ def test_minion_module_refresh(): |
256 |
+ minion.destroy() |
257 |
+ |
258 |
+ |
259 |
++@×××××××××××.skip("test needs root access") |
260 |
+ def test_minion_module_refresh_beacons_refresh(): |
261 |
+ """ |
262 |
+ Tests that 'module_refresh' calls beacons_refresh and that the |
263 |
+diff --git a/tests/pytests/unit/test_version.py b/tests/pytests/unit/test_version.py |
264 |
+index bc6bbfeadd..2653b558b0 100644 |
265 |
+--- a/tests/pytests/unit/test_version.py |
266 |
++++ b/tests/pytests/unit/test_version.py |
267 |
+@@ -140,6 +140,7 @@ def test_sha(commit, match): |
268 |
+ assert ret is None |
269 |
+ |
270 |
+ |
271 |
++@×××××××××××.skip("test is broken if some optional deps aren't installed") |
272 |
+ def test_version_report_lines(): |
273 |
+ """ |
274 |
+ Validate padding in versions report is correct |
275 |
+diff --git a/tests/support/helpers.py b/tests/support/helpers.py |
276 |
+index d82b14cb90..751018162c 100644 |
277 |
+--- a/tests/support/helpers.py |
278 |
++++ b/tests/support/helpers.py |
279 |
+@@ -40,7 +40,7 @@ import salt.utils.platform |
280 |
+ import salt.utils.pycrypto |
281 |
+ import salt.utils.stringutils |
282 |
+ import salt.utils.versions |
283 |
+-from saltfactories.exceptions import FactoryFailure as ProcessFailed |
284 |
++from pytestshellutils.exceptions import FactoryFailure as ProcessFailed |
285 |
+ from saltfactories.utils.ports import get_unused_localhost_port |
286 |
+ from saltfactories.utils.processes import ProcessResult |
287 |
+ from tests.support.mock import patch |
288 |
+@@ -1720,7 +1720,7 @@ class VirtualEnv: |
289 |
+ kwargs.setdefault("env", self.environ) |
290 |
+ proc = subprocess.run(args, check=False, **kwargs) |
291 |
+ ret = ProcessResult( |
292 |
+- exitcode=proc.returncode, |
293 |
++ returncode=proc.returncode, |
294 |
+ stdout=proc.stdout, |
295 |
+ stderr=proc.stderr, |
296 |
+ cmdline=proc.args, |
297 |
+@@ -1735,7 +1735,7 @@ class VirtualEnv: |
298 |
+ cmdline=proc.args, |
299 |
+ stdout=proc.stdout, |
300 |
+ stderr=proc.stderr, |
301 |
+- exitcode=proc.returncode, |
302 |
++ returncode=proc.returncode, |
303 |
+ ) |
304 |
+ return ret |
305 |
+ |
306 |
+diff --git a/tests/unit/modules/test_boto_route53.py b/tests/unit/modules/test_boto_route53.py |
307 |
+index 1d3d1393a9..df331761e2 100644 |
308 |
+--- a/tests/unit/modules/test_boto_route53.py |
309 |
++++ b/tests/unit/modules/test_boto_route53.py |
310 |
+@@ -4,6 +4,8 @@ from collections import namedtuple |
311 |
+ |
312 |
+ import pkg_resources # pylint: disable=3rd-party-module-not-gated |
313 |
+ |
314 |
++import pytest |
315 |
++ |
316 |
+ import salt.config |
317 |
+ import salt.loader |
318 |
+ import salt.utils.versions |
319 |
+@@ -99,6 +101,7 @@ class BotoRoute53TestCase(TestCase, LoaderModuleMockMixin): |
320 |
+ def tearDown(self): |
321 |
+ del self.opts |
322 |
+ |
323 |
++ @pytest.mark.skip("test currently broken") |
324 |
+ @mock_route53_deprecated |
325 |
+ def test_create_healthcheck(self): |
326 |
+ """ |
327 |
+diff --git a/tests/unit/utils/test_parsers.py b/tests/unit/utils/test_parsers.py |
328 |
+index 907c67f477..3f68cfe8f3 100644 |
329 |
+--- a/tests/unit/utils/test_parsers.py |
330 |
++++ b/tests/unit/utils/test_parsers.py |
331 |
+@@ -6,6 +6,8 @@ import os |
332 |
+ import shutil |
333 |
+ import tempfile |
334 |
+ |
335 |
++import pytest |
336 |
++ |
337 |
+ import salt.config |
338 |
+ import salt.log.setup as log |
339 |
+ import salt.syspaths |
340 |
+@@ -983,6 +985,7 @@ class SaltRunOptionParserTestCase(ParserBase, TestCase): |
341 |
+ if os.path.exists(self.log_file): |
342 |
+ os.unlink(self.log_file) |
343 |
+ |
344 |
++ @pytest.mark.skip("needs root access") |
345 |
+ def test_jid_option(self): |
346 |
+ jid = salt.utils.jid.gen_jid({}) |
347 |
+ args = ["--jid", jid] |
348 |
+@@ -991,6 +994,7 @@ class SaltRunOptionParserTestCase(ParserBase, TestCase): |
349 |
+ parser.parse_args(args) |
350 |
+ assert parser.options.jid == jid |
351 |
+ |
352 |
++ @pytest.mark.skip("needs root access") |
353 |
+ def test_jid_option_invalid(self): |
354 |
+ jid = salt.utils.jid.gen_jid({}) + "A" |
355 |
+ args = ["--jid", jid] |
356 |
+@@ -1041,6 +1045,7 @@ class SaltSSHOptionParserTestCase(ParserBase, TestCase): |
357 |
+ if os.path.exists(self.ssh_log_file): |
358 |
+ os.unlink(self.ssh_log_file) |
359 |
+ |
360 |
++ @pytest.mark.skip("needs root access") |
361 |
+ def test_jid_option(self): |
362 |
+ jid = salt.utils.jid.gen_jid({}) |
363 |
+ args = ["--jid", jid] + self.args |
364 |
+@@ -1049,6 +1054,7 @@ class SaltSSHOptionParserTestCase(ParserBase, TestCase): |
365 |
+ parser.parse_args(args) |
366 |
+ assert parser.options.jid == jid |
367 |
+ |
368 |
++ @pytest.mark.skip("needs root access") |
369 |
+ def test_jid_option_invalid(self): |
370 |
+ jid = salt.utils.jid.gen_jid({}) + "A" |
371 |
+ args = ["--jid", jid] + self.args |
372 |
|
373 |
diff --git a/app-admin/salt/salt-3004.1.ebuild b/app-admin/salt/salt-3004.1.ebuild |
374 |
new file mode 100644 |
375 |
index 000000000000..6f097cc01663 |
376 |
--- /dev/null |
377 |
+++ b/app-admin/salt/salt-3004.1.ebuild |
378 |
@@ -0,0 +1,204 @@ |
379 |
+# Copyright 1999-2022 Gentoo Authors |
380 |
+# Distributed under the terms of the GNU General Public License v2 |
381 |
+ |
382 |
+EAPI=8 |
383 |
+PYTHON_COMPAT=( python3_{8..10} ) |
384 |
+ |
385 |
+inherit systemd distutils-r1 |
386 |
+ |
387 |
+DESCRIPTION="Salt is a remote execution and configuration manager" |
388 |
+HOMEPAGE="https://www.saltstack.com/resources/community/ |
389 |
+ https://github.com/saltstack" |
390 |
+ |
391 |
+if [[ ${PV} == 9999* ]]; then |
392 |
+ inherit git-r3 |
393 |
+ EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git" |
394 |
+ EGIT_BRANCH="develop" |
395 |
+ SRC_URI="" |
396 |
+else |
397 |
+ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
398 |
+ KEYWORDS="~amd64" |
399 |
+fi |
400 |
+ |
401 |
+LICENSE="Apache-2.0" |
402 |
+SLOT="0" |
403 |
+IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako |
404 |
+ mongodb neutron nova openssl portage profile redis selinux test raet |
405 |
+ +zeromq vim-syntax" |
406 |
+ |
407 |
+RDEPEND=" |
408 |
+ sys-apps/pciutils |
409 |
+ >=dev-python/distro-1.5[${PYTHON_USEDEP}] |
410 |
+ >=dev-python/jinja-3.0[${PYTHON_USEDEP}] |
411 |
+ dev-python/libnacl[${PYTHON_USEDEP}] |
412 |
+ >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}] |
413 |
+ >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}] |
414 |
+ dev-python/pyyaml[${PYTHON_USEDEP}] |
415 |
+ dev-python/markupsafe[${PYTHON_USEDEP}] |
416 |
+ >=dev-python/requests-1.0.0[${PYTHON_USEDEP}] |
417 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
418 |
+ >=dev-python/toml-0.10.2[${PYTHON_USEDEP}] |
419 |
+ dev-python/watchdog[${PYTHON_USEDEP}] |
420 |
+ libcloud? ( >=dev-python/libcloud-2.5.0[${PYTHON_USEDEP}] ) |
421 |
+ mako? ( dev-python/mako[${PYTHON_USEDEP}] ) |
422 |
+ ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] ) |
423 |
+ libvirt? ( |
424 |
+ $(python_gen_cond_dep 'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_8) |
425 |
+ ) |
426 |
+ openssl? ( |
427 |
+ dev-libs/openssl:0=[-bindist(-)] |
428 |
+ dev-python/pyopenssl[${PYTHON_USEDEP}] |
429 |
+ ) |
430 |
+ raet? ( |
431 |
+ >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}] |
432 |
+ >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}] |
433 |
+ >=dev-python/raet-0.6.0[${PYTHON_USEDEP}] |
434 |
+ ) |
435 |
+ cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] ) |
436 |
+ cheetah? ( >=dev-python/cheetah3-3.2.2[${PYTHON_USEDEP}] ) |
437 |
+ genshi? ( dev-python/genshi[${PYTHON_USEDEP}] ) |
438 |
+ mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] ) |
439 |
+ portage? ( sys-apps/portage[${PYTHON_USEDEP}] ) |
440 |
+ keyring? ( dev-python/keyring[${PYTHON_USEDEP}] ) |
441 |
+ redis? ( dev-python/redis-py[${PYTHON_USEDEP}] ) |
442 |
+ selinux? ( sec-policy/selinux-salt ) |
443 |
+ nova? ( |
444 |
+ $(python_gen_cond_dep '>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_8) |
445 |
+ ) |
446 |
+ neutron? ( |
447 |
+ $(python_gen_cond_dep '>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_8) |
448 |
+ ) |
449 |
+ gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] ) |
450 |
+ profile? ( dev-python/yappi[${PYTHON_USEDEP}] ) |
451 |
+ vim-syntax? ( app-vim/salt-vim ) |
452 |
+ zeromq? ( >=dev-python/pyzmq-2.2.0[${PYTHON_USEDEP}] ) |
453 |
+" |
454 |
+BDEPEND=" |
455 |
+ test? ( |
456 |
+ ${RDEPEND} |
457 |
+ >=dev-python/boto-2.32.1[${PYTHON_USEDEP}] |
458 |
+ >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}] |
459 |
+ dev-python/mako[${PYTHON_USEDEP}] |
460 |
+ >=dev-python/mock-2.0.0[${PYTHON_USEDEP}] |
461 |
+ >=dev-python/moto-0.3.6[${PYTHON_USEDEP}] |
462 |
+ dev-python/pip[${PYTHON_USEDEP}] |
463 |
+ >=dev-python/psutil-5.0.0[${PYTHON_USEDEP}] |
464 |
+ dev-python/pyopenssl[${PYTHON_USEDEP}] |
465 |
+ dev-python/pytest[${PYTHON_USEDEP}] |
466 |
+ >=dev-python/pytest-salt-factories-1.0.0_rc13[${PYTHON_USEDEP}] |
467 |
+ dev-python/pytest-tempdir[${PYTHON_USEDEP}] |
468 |
+ dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}] |
469 |
+ dev-python/pytest-subtests[${PYTHON_USEDEP}] |
470 |
+ dev-python/flaky[${PYTHON_USEDEP}] |
471 |
+ dev-python/libcloud[${PYTHON_USEDEP}] |
472 |
+ net-dns/bind-tools |
473 |
+ >=dev-python/virtualenv-20.3.0[${PYTHON_USEDEP}] |
474 |
+ !x86? ( >=dev-python/boto3-1.17.67[${PYTHON_USEDEP}] ) |
475 |
+ )" |
476 |
+ |
477 |
+DOCS=( README.rst AUTHORS ) |
478 |
+ |
479 |
+REQUIRED_USE="|| ( raet zeromq ) |
480 |
+ test? ( cheetah genshi )" |
481 |
+RESTRICT="!test? ( test ) x86? ( test )" |
482 |
+ |
483 |
+PATCHES=( |
484 |
+ "${FILESDIR}/salt-3003-skip-tests-that-oom-machine.patch" |
485 |
+ "${FILESDIR}/salt-3003-gentoolkit-revdep.patch" |
486 |
+ "${FILESDIR}/salt-3002-tests.patch" |
487 |
+ "${FILESDIR}/salt-3003.1-tests.patch" |
488 |
+ "${FILESDIR}/salt-3004.1-jinja-3.patch" |
489 |
+ "${FILESDIR}/salt-3004.1-tests.patch" |
490 |
+) |
491 |
+ |
492 |
+python_prepare_all() { |
493 |
+ # remove tests with external dependencies that may not be available, and |
494 |
+ # tests that don't work in sandbox |
495 |
+ rm tests/unit/{test_{zypp_plugins,module_names},utils/test_extend}.py || die |
496 |
+ rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die |
497 |
+ rm tests/unit/states/test_boto_vpc.py || die |
498 |
+ rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die |
499 |
+ rm tests/pytests/functional/transport/server/test_req_channel.py || die |
500 |
+ |
501 |
+ # tests that require network access |
502 |
+ rm tests/unit/{states,modules}/test_zcbuildout.py || die |
503 |
+ rm -r tests/integration/cloud || die |
504 |
+ rm -r tests/kitchen/tests/wordpress/tests || die |
505 |
+ rm tests/kitchen/test_kitchen.py || die |
506 |
+ rm tests/unit/modules/test_network.py || die |
507 |
+ rm tests/pytests/functional/modules/test_pip.py || die |
508 |
+ rm tests/pytests/unit/client/ssh/test_ssh.py || die |
509 |
+ |
510 |
+ # tests require root access |
511 |
+ rm tests/integration/pillar/test_git_pillar.py || die |
512 |
+ rm tests/integration/states/test_supervisord.py || die |
513 |
+ |
514 |
+ # make sure pkg_resources doesn't bomb because pycrypto isn't installed |
515 |
+ find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die |
516 |
+ # pycryptodome rather than pycryptodomex |
517 |
+ find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die |
518 |
+ |
519 |
+ distutils-r1_python_prepare_all |
520 |
+} |
521 |
+ |
522 |
+python_prepare() { |
523 |
+ einfo "Fixing collections.abc warnings for ${EPYTHON}" |
524 |
+ local abc |
525 |
+ abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die |
526 |
+ find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die |
527 |
+ |
528 |
+ # removes contextvars, see bug: https://bugs.gentoo.org/799431 |
529 |
+ sed -i '/^contextvars/d' requirements/base.txt || die |
530 |
+} |
531 |
+ |
532 |
+python_install_all() { |
533 |
+ local svc |
534 |
+ USE_SETUPTOOLS=1 distutils-r1_python_install_all |
535 |
+ |
536 |
+ for svc in minion master syndic api; do |
537 |
+ newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc} |
538 |
+ newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc} |
539 |
+ systemd_dounit "${FILESDIR}"/salt-${svc}.service |
540 |
+ done |
541 |
+ |
542 |
+ insinto /etc/${PN} |
543 |
+ doins -r conf/* |
544 |
+} |
545 |
+ |
546 |
+python_test() { |
547 |
+ # testsuite likes lots of files |
548 |
+ ulimit -n 4096 || die |
549 |
+ |
550 |
+ # ${T} is too long a path for the tests to work |
551 |
+ local TMPDIR |
552 |
+ TMPDIR="$(mktemp --directory --tmpdir=/tmp ${PN}-XXXX)" |
553 |
+ ( |
554 |
+ export TMPDIR |
555 |
+ cleanup() { rm -rf "${TMPDIR}" || die; } |
556 |
+ |
557 |
+ trap cleanup EXIT |
558 |
+ |
559 |
+ addwrite "${TMPDIR}" |
560 |
+ |
561 |
+ USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \ |
562 |
+ "${EPYTHON}" -m pytest -vv \ |
563 |
+ || die "testing failed with ${EPYTHON}" |
564 |
+ ) |
565 |
+} |
566 |
+ |
567 |
+pkg_postinst() { |
568 |
+ if use python_targets_python3_8; then |
569 |
+ if use nova; then |
570 |
+ ewarn "Salt's nova functionality will not work with python3.8 since" |
571 |
+ ewarn "dev-python/python-novaclient does not support it yet" |
572 |
+ fi |
573 |
+ if use neutron; then |
574 |
+ ewarn "Salt's neutron functionality will not work with python3.8 since" |
575 |
+ ewarn "dev-python/python-neutronclient does not support it yet" |
576 |
+ fi |
577 |
+ if use libvirt; then |
578 |
+ ewarn "Salt's libvirt functionality will not work with python3.8 since" |
579 |
+ ewarn "dev-python/libvirt-python does not support it yet" |
580 |
+ fi |
581 |
+ fi |
582 |
+} |