From 2ed3809357bcecc011c1e704b167eeb22c6fbf2e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 22:59:35 +0000 Subject: [PATCH] ci: This PR is to trigger periodic CI testing --- tests/callback_plugins/dump_packages.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/callback_plugins/dump_packages.py b/tests/callback_plugins/dump_packages.py index 3ec9cf1..15aa6db 100644 --- a/tests/callback_plugins/dump_packages.py +++ b/tests/callback_plugins/dump_packages.py @@ -41,8 +41,19 @@ def __init__(self, *args, **kwargs): def v2_runner_on_ok(self, result): fields = result._task_fields if fields["action"] == "package" and fields["args"].get("state") != "absent": - if isinstance(fields["args"]["name"], list): - packages = " ".join(fields["args"]["name"]) - else: - packages = fields["args"]["name"] - self._display.display("lsrpackages: " + packages) + packages = set() + if "invocation" in result._result: + results = [result._result] + elif "results" in result._result and isinstance( + result._result["results"], list + ): + results = result._result["results"] + for item in results: + pkgs = item["invocation"]["module_args"]["name"] + if isinstance(pkgs, list): + for ii in pkgs: + packages.add(ii) + else: + packages.add(pkgs) + + self._display.display("lsrpackages: " + " ".join(sorted(list(packages))))