Skip to content

Commit bcbd0ad

Browse files
ci: This PR is to trigger periodic CI testing
1 parent aefb0aa commit bcbd0ad

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright (C) 2023, Red Hat, Inc.
3+
# SPDX-License-Identifier: MIT
4+
5+
from __future__ import absolute_import, division, print_function
6+
7+
__metaclass__ = type
8+
9+
DOCUMENTATION = """
10+
author: Rich Megginson
11+
name: dump_packages
12+
type: aggregate
13+
short_description: dump arguments to package module
14+
description:
15+
- Dump arguments to package module to get list of packages.
16+
- Used in conjunction with CI testing to get the packages used
17+
- with all combinations of: distribution/version/role arguments
18+
- Used to generate lists of packages for ostree image builds.
19+
requirements:
20+
- None
21+
"""
22+
23+
from ansible.plugins.callback import CallbackBase # noqa: E402
24+
25+
26+
class CallbackModule(CallbackBase):
27+
"""
28+
Dump packages.
29+
"""
30+
31+
CALLBACK_VERSION = 2.0
32+
CALLBACK_TYPE = "aggregate"
33+
CALLBACK_NAME = "dump_packages"
34+
# needed for 2.9 compatibility
35+
CALLBACK_NEEDS_WHITELIST = False # wokeignore:rule=whitelist
36+
CALLBACK_NEEDS_ENABLED = False
37+
38+
def __init__(self, *args, **kwargs):
39+
super(CallbackModule, self).__init__(*args, **kwargs)
40+
41+
def v2_runner_on_ok(self, result):
42+
fields = result._task_fields
43+
if fields["action"] == "package" and fields["args"].get("state") != "absent":
44+
if isinstance(fields["args"]["name"], list):
45+
packages = " ".join(fields["args"]["name"])
46+
else:
47+
packages = fields["args"]["name"]
48+
self._display.display("lsrpackages: " + packages)

0 commit comments

Comments
 (0)