1 |
commit: 2c7bdc17799ac9bc164ff4ec92f7105f3a9d6cad |
2 |
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com> |
3 |
AuthorDate: Tue Aug 27 21:37:18 2019 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 27 21:38:28 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c7bdc17 |
7 |
|
8 |
app-admin/salt: Revbump, update to work with newer deps |
9 |
|
10 |
Newer pyyaml and jsonschema need patches to pass tests properly. |
11 |
|
12 |
Copyright: Sony Interactive Entertainment Inc. |
13 |
Package-Manager: Portage-2.3.73, Repoman-2.3.17 |
14 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
15 |
|
16 |
.../salt/files/salt-2019.2.0-newer-deps.patch | 210 +++++++++++++++++++++ |
17 |
...salt-2019.2.0-skip-tests-that-oom-machine.patch | 20 ++ |
18 |
...alt-2019.2.0.ebuild => salt-2019.2.0-r1.ebuild} | 8 +- |
19 |
3 files changed, 235 insertions(+), 3 deletions(-) |
20 |
|
21 |
diff --git a/app-admin/salt/files/salt-2019.2.0-newer-deps.patch b/app-admin/salt/files/salt-2019.2.0-newer-deps.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..bdf95e21089 |
24 |
--- /dev/null |
25 |
+++ b/app-admin/salt/files/salt-2019.2.0-newer-deps.patch |
26 |
@@ -0,0 +1,210 @@ |
27 |
+diff --git a/salt/modules/dockercompose.py b/salt/modules/dockercompose.py |
28 |
+index 61e937536c..0f37e0d43a 100644 |
29 |
+--- a/salt/modules/dockercompose.py |
30 |
++++ b/salt/modules/dockercompose.py |
31 |
+@@ -241,7 +241,7 @@ def __load_docker_compose(path): |
32 |
+ None, None) |
33 |
+ try: |
34 |
+ with salt.utils.files.fopen(file_path, 'r') as fl: |
35 |
+- loaded = yaml.load(fl) |
36 |
++ loaded = yaml.safe_load(fl) |
37 |
+ except EnvironmentError: |
38 |
+ return None, __standardize_result(False, |
39 |
+ 'Could not read {0}'.format(file_path), |
40 |
+@@ -371,7 +371,7 @@ def __load_compose_definitions(path, definition): |
41 |
+ None, None) |
42 |
+ else: |
43 |
+ try: |
44 |
+- loaded_definition = yaml.load(definition) |
45 |
++ loaded_definition = yaml.safe_load(definition) |
46 |
+ except yaml.YAMLError as yerr: |
47 |
+ msg = 'Could not parse {0} {1}'.format(definition, yerr) |
48 |
+ return None, None, __standardize_result(False, msg, |
49 |
+diff --git a/salt/serializers/yaml.py b/salt/serializers/yaml.py |
50 |
+index c95b40e48f..2154e5dcab 100644 |
51 |
+--- a/salt/serializers/yaml.py |
52 |
++++ b/salt/serializers/yaml.py |
53 |
+@@ -72,6 +72,7 @@ def serialize(obj, **options): |
54 |
+ ''' |
55 |
+ |
56 |
+ options.setdefault('Dumper', Dumper) |
57 |
++ options.setdefault('default_flow_style', None) |
58 |
+ try: |
59 |
+ response = yaml.dump(obj, **options) |
60 |
+ if response.endswith('\n...\n'): |
61 |
+diff --git a/salt/serializers/yamlex.py b/salt/serializers/yamlex.py |
62 |
+index 2e4ba6fb2b..e42634f580 100644 |
63 |
+--- a/salt/serializers/yamlex.py |
64 |
++++ b/salt/serializers/yamlex.py |
65 |
+@@ -182,6 +182,7 @@ def serialize(obj, **options): |
66 |
+ ''' |
67 |
+ |
68 |
+ options.setdefault('Dumper', Dumper) |
69 |
++ options.setdefault('default_flow_style', None) |
70 |
+ try: |
71 |
+ response = yaml.dump(obj, **options) |
72 |
+ if response.endswith('\n...\n'): |
73 |
+diff --git a/salt/utils/yamldumper.py b/salt/utils/yamldumper.py |
74 |
+index 9892c87d23..3692ea324a 100644 |
75 |
+--- a/salt/utils/yamldumper.py |
76 |
++++ b/salt/utils/yamldumper.py |
77 |
+@@ -115,6 +115,7 @@ def dump(data, stream=None, **kwargs): |
78 |
+ ''' |
79 |
+ if 'allow_unicode' not in kwargs: |
80 |
+ kwargs['allow_unicode'] = True |
81 |
++ kwargs.setdefault('default_flow_style', None) |
82 |
+ return yaml.dump(data, stream, **kwargs) |
83 |
+ |
84 |
+ |
85 |
+@@ -126,4 +127,5 @@ def safe_dump(data, stream=None, **kwargs): |
86 |
+ ''' |
87 |
+ if 'allow_unicode' not in kwargs: |
88 |
+ kwargs['allow_unicode'] = True |
89 |
++ kwargs.setdefault('default_flow_style', None) |
90 |
+ return yaml.dump(data, stream, Dumper=SafeOrderedDumper, **kwargs) |
91 |
+diff --git a/tests/integration/utils/test_win_runas.py b/tests/integration/utils/test_win_runas.py |
92 |
+index 3042a77991..d4057a4d03 100644 |
93 |
+--- a/tests/integration/utils/test_win_runas.py |
94 |
++++ b/tests/integration/utils/test_win_runas.py |
95 |
+@@ -539,7 +539,7 @@ class RunAsTest(ModuleCase): |
96 |
+ win32serviceutil.StartService('test service') |
97 |
+ wait_for_service('test service') |
98 |
+ with salt.utils.files.fopen(RUNAS_OUT, 'r') as fp: |
99 |
+- ret = yaml.load(fp) |
100 |
++ ret = yaml.safe_load(fp) |
101 |
+ assert ret['retcode'] == 1, ret |
102 |
+ |
103 |
+ @with_system_user('test-runas', on_existing='delete', delete=True, |
104 |
+@@ -560,7 +560,7 @@ class RunAsTest(ModuleCase): |
105 |
+ win32serviceutil.StartService('test service') |
106 |
+ wait_for_service('test service') |
107 |
+ with salt.utils.files.fopen(RUNAS_OUT, 'r') as fp: |
108 |
+- ret = yaml.load(fp) |
109 |
++ ret = yaml.safe_load(fp) |
110 |
+ assert ret['retcode'] == 1, ret |
111 |
+ |
112 |
+ @with_system_user('test-runas-admin', on_existing='delete', delete=True, |
113 |
+@@ -581,7 +581,7 @@ class RunAsTest(ModuleCase): |
114 |
+ win32serviceutil.StartService('test service') |
115 |
+ wait_for_service('test service') |
116 |
+ with salt.utils.files.fopen(RUNAS_OUT, 'r') as fp: |
117 |
+- ret = yaml.load(fp) |
118 |
++ ret = yaml.safe_load(fp) |
119 |
+ assert ret['retcode'] == 0, ret |
120 |
+ |
121 |
+ @with_system_user('test-runas-admin', on_existing='delete', delete=True, |
122 |
+@@ -602,7 +602,7 @@ class RunAsTest(ModuleCase): |
123 |
+ win32serviceutil.StartService('test service') |
124 |
+ wait_for_service('test service') |
125 |
+ with salt.utils.files.fopen(RUNAS_OUT, 'r') as fp: |
126 |
+- ret = yaml.load(fp) |
127 |
++ ret = yaml.safe_load(fp) |
128 |
+ assert ret['retcode'] == 0, ret |
129 |
+ |
130 |
+ def test_runas_service_system_user(self): |
131 |
+@@ -621,5 +621,5 @@ class RunAsTest(ModuleCase): |
132 |
+ win32serviceutil.StartService('test service') |
133 |
+ wait_for_service('test service') |
134 |
+ with salt.utils.files.fopen(RUNAS_OUT, 'r') as fp: |
135 |
+- ret = yaml.load(fp) |
136 |
++ ret = yaml.safe_load(fp) |
137 |
+ assert ret['retcode'] == 0, ret |
138 |
+diff --git a/tests/unit/serializers/test_serializers.py b/tests/unit/serializers/test_serializers.py |
139 |
+index 3bf42b67d7..ea42d617d7 100644 |
140 |
+--- a/tests/unit/serializers/test_serializers.py |
141 |
++++ b/tests/unit/serializers/test_serializers.py |
142 |
+@@ -68,9 +68,24 @@ class TestSerializers(TestCase): |
143 |
+ serialized = yamlex.serialize(data) |
144 |
+ assert serialized == '{foo: bar}', serialized |
145 |
+ |
146 |
++ serialized = yamlex.serialize(data, default_flow_style=False) |
147 |
++ assert serialized == 'foo: bar', serialized |
148 |
++ |
149 |
+ deserialized = yamlex.deserialize(serialized) |
150 |
+ assert deserialized == data, deserialized |
151 |
+ |
152 |
++ serialized = yaml.serialize(data) |
153 |
++ assert serialized == '{foo: bar}', serialized |
154 |
++ |
155 |
++ deserialized = yaml.deserialize(serialized) |
156 |
++ assert deserialized == data, deserialized |
157 |
++ |
158 |
++ serialized = yaml.serialize(data, default_flow_style=False) |
159 |
++ assert serialized == 'foo: bar', serialized |
160 |
++ |
161 |
++ deserialized = yaml.deserialize(serialized) |
162 |
++ assert deserialized == data, deserialized |
163 |
++ |
164 |
+ @skipIf(not yamlex.available, SKIP_MESSAGE % 'sls') |
165 |
+ def test_serialize_complex_sls(self): |
166 |
+ data = OrderedDict([ |
167 |
+@@ -84,6 +99,12 @@ class TestSerializers(TestCase): |
168 |
+ deserialized = yamlex.deserialize(serialized) |
169 |
+ assert deserialized == data, deserialized |
170 |
+ |
171 |
++ serialized = yaml.serialize(data) |
172 |
++ assert serialized == '{bar: 2, baz: true, foo: 1}', serialized |
173 |
++ |
174 |
++ deserialized = yaml.deserialize(serialized) |
175 |
++ assert deserialized == data, deserialized |
176 |
++ |
177 |
+ @skipIf(not yaml.available, SKIP_MESSAGE % 'yaml') |
178 |
+ @skipIf(not yamlex.available, SKIP_MESSAGE % 'sls') |
179 |
+ def test_compare_sls_vs_yaml(self): |
180 |
+diff --git a/tests/unit/utils/test_schema.py b/tests/unit/utils/test_schema.py |
181 |
+index 677cd0778b..5c2f1fd8fd 100644 |
182 |
+--- a/tests/unit/utils/test_schema.py |
183 |
++++ b/tests/unit/utils/test_schema.py |
184 |
+@@ -5,6 +5,7 @@ |
185 |
+ |
186 |
+ # Import python libs |
187 |
+ from __future__ import absolute_import, print_function, unicode_literals |
188 |
++import sys |
189 |
+ import copy |
190 |
+ |
191 |
+ # Import Salt Testing Libs |
192 |
+@@ -506,7 +507,7 @@ class ConfigTestCase(TestCase): |
193 |
+ {'personal_access_token': 'foo'}, |
194 |
+ Requirements.serialize() |
195 |
+ ) |
196 |
+- self.assertIn('is not valid under any of the given schemas', excinfo.exception.message) |
197 |
++ self.assertIn("'ssh_key_file' is a required property", excinfo.exception.message) |
198 |
+ |
199 |
+ def test_boolean_config(self): |
200 |
+ item = schema.BooleanItem(title='Hungry', description='Are you hungry?') |
201 |
+@@ -1730,7 +1731,10 @@ class ConfigTestCase(TestCase): |
202 |
+ |
203 |
+ with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo: |
204 |
+ jsonschema.validate({'item': {'sides': '4', 'color': 'blue'}}, TestConf.serialize()) |
205 |
+- self.assertIn('is not valid under any of the given schemas', excinfo.exception.message) |
206 |
++ if sys.hexversion >= 0x03000000: |
207 |
++ self.assertIn("'4' is not of type 'boolean'", excinfo.exception.message) |
208 |
++ else: |
209 |
++ self.assertIn("u'4' is not of type u'boolean'", excinfo.exception.message) |
210 |
+ |
211 |
+ class TestConf(schema.Schema): |
212 |
+ item = schema.DictItem( |
213 |
+@@ -1833,7 +1837,10 @@ class ConfigTestCase(TestCase): |
214 |
+ |
215 |
+ with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo: |
216 |
+ jsonschema.validate({'item': ['maybe']}, TestConf.serialize()) |
217 |
+- self.assertIn('is not valid under any of the given schemas', excinfo.exception.message) |
218 |
++ if sys.hexversion >= 0x03000000: |
219 |
++ self.assertIn("'maybe' is not one of ['yes']", excinfo.exception.message) |
220 |
++ else: |
221 |
++ self.assertIn("u'maybe' is not one of [u'yes']", excinfo.exception.message) |
222 |
+ |
223 |
+ with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo: |
224 |
+ jsonschema.validate({'item': 2}, TestConf.serialize()) |
225 |
+@@ -1885,7 +1892,10 @@ class ConfigTestCase(TestCase): |
226 |
+ |
227 |
+ with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo: |
228 |
+ jsonschema.validate({'item': ['maybe']}, TestConf.serialize()) |
229 |
+- self.assertIn('is not valid under any of the given schemas', excinfo.exception.message) |
230 |
++ if sys.hexversion >= 0x03000000: |
231 |
++ self.assertIn("'maybe' is not one of ['yes']", excinfo.exception.message) |
232 |
++ else: |
233 |
++ self.assertIn("u'maybe' is not one of [u'yes']", excinfo.exception.message) |
234 |
+ |
235 |
+ with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo: |
236 |
+ jsonschema.validate({'item': 2}, TestConf.serialize()) |
237 |
|
238 |
diff --git a/app-admin/salt/files/salt-2019.2.0-skip-tests-that-oom-machine.patch b/app-admin/salt/files/salt-2019.2.0-skip-tests-that-oom-machine.patch |
239 |
new file mode 100644 |
240 |
index 00000000000..d0172d73955 |
241 |
--- /dev/null |
242 |
+++ b/app-admin/salt/files/salt-2019.2.0-skip-tests-that-oom-machine.patch |
243 |
@@ -0,0 +1,20 @@ |
244 |
+diff --git a/tests/unit/modules/test_boto_apigateway.py b/tests/unit/modules/test_boto_apigateway.py |
245 |
+index be26b3f093..ca971556d5 100644 |
246 |
+--- a/tests/unit/modules/test_boto_apigateway.py |
247 |
++++ b/tests/unit/modules/test_boto_apigateway.py |
248 |
+@@ -169,6 +169,7 @@ def _has_required_botocore(): |
249 |
+ return True |
250 |
+ |
251 |
+ |
252 |
++@skipIf(True, "Causes machines to OOM") |
253 |
+ class BotoApiGatewayTestCaseBase(TestCase, LoaderModuleMockMixin): |
254 |
+ conn = None |
255 |
+ |
256 |
+@@ -207,6 +208,7 @@ class BotoApiGatewayTestCaseBase(TestCase, LoaderModuleMockMixin): |
257 |
+ self.addCleanup(delattr, self, 'conn') |
258 |
+ |
259 |
+ |
260 |
++@skipIf(True, "Causes machines to OOM") |
261 |
+ class BotoApiGatewayTestCaseMixin(object): |
262 |
+ def _diff_list_dicts(self, listdict1, listdict2, sortkey): |
263 |
+ ''' |
264 |
|
265 |
diff --git a/app-admin/salt/salt-2019.2.0.ebuild b/app-admin/salt/salt-2019.2.0-r1.ebuild |
266 |
similarity index 94% |
267 |
rename from app-admin/salt/salt-2019.2.0.ebuild |
268 |
rename to app-admin/salt/salt-2019.2.0-r1.ebuild |
269 |
index 16433de1b07..eb02c39bf6f 100644 |
270 |
--- a/app-admin/salt/salt-2019.2.0.ebuild |
271 |
+++ b/app-admin/salt/salt-2019.2.0-r1.ebuild |
272 |
@@ -92,9 +92,11 @@ REQUIRED_USE="|| ( raet zeromq )" |
273 |
RESTRICT="x86? ( test )" |
274 |
|
275 |
PATCHES=( |
276 |
- "${FILESDIR}/${PN}-2017.7.0-dont-realpath-tmpdir.patch" |
277 |
- "${FILESDIR}/${PN}-2019.2.0-tests.patch" |
278 |
- "${FILESDIR}/${PN}-2018.3.2-skip-zeromq-test-that-hangs.patch" |
279 |
+ "${FILESDIR}/salt-2017.7.0-dont-realpath-tmpdir.patch" |
280 |
+ "${FILESDIR}/salt-2019.2.0-tests.patch" |
281 |
+ "${FILESDIR}/salt-2018.3.2-skip-zeromq-test-that-hangs.patch" |
282 |
+ "${FILESDIR}/salt-2019.2.0-skip-tests-that-oom-machine.patch" |
283 |
+ "${FILESDIR}/salt-2019.2.0-newer-deps.patch" |
284 |
) |
285 |
|
286 |
python_prepare() { |