osism 0.20251003.0__py3-none-any.whl → 0.20251012.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- osism/commands/apply.py +65 -34
- osism/commands/manage.py +725 -1
- osism/commands/server.py +97 -2
- osism/commands/stress.py +213 -0
- osism/data/__init__.py +34 -0
- osism/data/enums.py +54 -4
- osism/tasks/__init__.py +23 -4
- osism/tasks/openstack.py +80 -0
- {osism-0.20251003.0.dist-info → osism-0.20251012.0.dist-info}/METADATA +2 -2
- {osism-0.20251003.0.dist-info → osism-0.20251012.0.dist-info}/RECORD +16 -15
- {osism-0.20251003.0.dist-info → osism-0.20251012.0.dist-info}/entry_points.txt +4 -0
- osism-0.20251012.0.dist-info/pbr.json +1 -0
- osism-0.20251003.0.dist-info/pbr.json +0 -1
- {osism-0.20251003.0.dist-info → osism-0.20251012.0.dist-info}/WHEEL +0 -0
- {osism-0.20251003.0.dist-info → osism-0.20251012.0.dist-info}/licenses/AUTHORS +0 -0
- {osism-0.20251003.0.dist-info → osism-0.20251012.0.dist-info}/licenses/LICENSE +0 -0
- {osism-0.20251003.0.dist-info → osism-0.20251012.0.dist-info}/top_level.txt +0 -0
osism/commands/apply.py
CHANGED
@@ -92,6 +92,13 @@ class Run(Command):
|
|
92
92
|
help="Dry run, do not initiate tasks (for collections only)",
|
93
93
|
action="store_true",
|
94
94
|
)
|
95
|
+
parser.add_argument(
|
96
|
+
"--show-tree",
|
97
|
+
dest="show_tree",
|
98
|
+
default=False,
|
99
|
+
help="Show only the execution tree for collections without additional output",
|
100
|
+
action="store_true",
|
101
|
+
)
|
95
102
|
parser.add_argument("role", nargs="?", type=str, help="Role to be applied")
|
96
103
|
parser.add_argument(
|
97
104
|
"arguments", nargs=argparse.REMAINDER, help="Other arguments for Ansible"
|
@@ -141,6 +148,7 @@ class Run(Command):
|
|
141
148
|
task_timeout,
|
142
149
|
retry,
|
143
150
|
dry_run,
|
151
|
+
show_tree,
|
144
152
|
):
|
145
153
|
g = []
|
146
154
|
for item in data:
|
@@ -149,7 +157,10 @@ class Run(Command):
|
|
149
157
|
# e.g. "loadbalancer"
|
150
158
|
logger.info(f"A [{counter}] {'-' * (counter + 1)} {item[0]}")
|
151
159
|
|
152
|
-
if
|
160
|
+
if show_tree:
|
161
|
+
# Only show the tree, don't create tasks
|
162
|
+
pt = None
|
163
|
+
elif dry_run:
|
153
164
|
pt = ansible.noop.si()
|
154
165
|
else:
|
155
166
|
pt = self._prepare_task(
|
@@ -182,17 +193,23 @@ class Run(Command):
|
|
182
193
|
task_timeout,
|
183
194
|
retry,
|
184
195
|
dry_run,
|
196
|
+
show_tree,
|
185
197
|
)
|
186
|
-
|
198
|
+
if not show_tree:
|
199
|
+
g.append(chain(pt, st))
|
187
200
|
else:
|
188
|
-
|
201
|
+
if not show_tree:
|
202
|
+
g.append(pt)
|
189
203
|
for inner_item in item[1:]:
|
190
204
|
if type(inner_item) == list:
|
191
205
|
logger.info(
|
192
206
|
f"B [{counter}] {'-' * (counter + 1)} {inner_item[0]}"
|
193
207
|
)
|
194
208
|
|
195
|
-
if
|
209
|
+
if show_tree:
|
210
|
+
# Only show the tree, don't create tasks
|
211
|
+
pt = None
|
212
|
+
elif dry_run:
|
196
213
|
pt = ansible.noop.si()
|
197
214
|
else:
|
198
215
|
pt = self._prepare_task(
|
@@ -225,45 +242,50 @@ class Run(Command):
|
|
225
242
|
task_timeout,
|
226
243
|
retry,
|
227
244
|
dry_run,
|
245
|
+
show_tree,
|
228
246
|
)
|
229
|
-
|
247
|
+
if not show_tree:
|
248
|
+
g.append(chain(pt, st))
|
230
249
|
else:
|
231
|
-
|
250
|
+
if not show_tree:
|
251
|
+
g.append(pt)
|
232
252
|
else:
|
233
253
|
logger.info(
|
234
254
|
f"C [{counter}] {'-' * (counter + 1)} {inner_item}"
|
235
255
|
)
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
256
|
+
if not show_tree:
|
257
|
+
g.append(
|
258
|
+
self._prepare_task(
|
259
|
+
arguments,
|
260
|
+
environment,
|
261
|
+
overwrite,
|
262
|
+
sub,
|
263
|
+
inner_item,
|
264
|
+
action,
|
265
|
+
wait,
|
266
|
+
format,
|
267
|
+
timeout,
|
268
|
+
task_timeout,
|
269
|
+
)
|
248
270
|
)
|
249
|
-
)
|
250
271
|
# e.g. "common"
|
251
272
|
else:
|
252
273
|
logger.info(f"D [{counter}] {'-' * (counter + 1)} {item}")
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
274
|
+
if not show_tree:
|
275
|
+
g.append(
|
276
|
+
self._prepare_task(
|
277
|
+
arguments,
|
278
|
+
environment,
|
279
|
+
overwrite,
|
280
|
+
sub,
|
281
|
+
item,
|
282
|
+
action,
|
283
|
+
wait,
|
284
|
+
format,
|
285
|
+
timeout,
|
286
|
+
task_timeout,
|
287
|
+
)
|
265
288
|
)
|
266
|
-
)
|
267
289
|
|
268
290
|
if g:
|
269
291
|
return group(g)
|
@@ -282,9 +304,12 @@ class Run(Command):
|
|
282
304
|
task_timeout,
|
283
305
|
retry,
|
284
306
|
dry_run,
|
307
|
+
show_tree,
|
285
308
|
):
|
286
309
|
if dry_run:
|
287
310
|
logger.info(f"Dry run for collection {collection}. No tasks are scheduled.")
|
311
|
+
elif show_tree:
|
312
|
+
logger.info(f"Showing execution tree for collection {collection}")
|
288
313
|
else:
|
289
314
|
logger.info(f"Collection {collection} is prepared for execution")
|
290
315
|
|
@@ -303,10 +328,14 @@ class Run(Command):
|
|
303
328
|
task_timeout,
|
304
329
|
retry,
|
305
330
|
dry_run,
|
331
|
+
show_tree,
|
306
332
|
)
|
307
|
-
|
333
|
+
|
334
|
+
# Only apply tasks if not in show_tree mode
|
335
|
+
if t and not show_tree:
|
308
336
|
t.apply_async()
|
309
|
-
|
337
|
+
|
338
|
+
if not dry_run and not show_tree:
|
310
339
|
logger.info(
|
311
340
|
f"All tasks of the collection {collection} are prepared for execution"
|
312
341
|
)
|
@@ -467,6 +496,7 @@ class Run(Command):
|
|
467
496
|
task_timeout = parsed_args.task_timeout
|
468
497
|
wait = not parsed_args.no_wait
|
469
498
|
dry_run = parsed_args.dry_run
|
499
|
+
show_tree = parsed_args.show_tree
|
470
500
|
|
471
501
|
rc = 0
|
472
502
|
|
@@ -496,6 +526,7 @@ class Run(Command):
|
|
496
526
|
task_timeout,
|
497
527
|
retry,
|
498
528
|
dry_run,
|
529
|
+
show_tree,
|
499
530
|
)
|
500
531
|
if rc != 0:
|
501
532
|
outer_break = True
|