From 8c06b7a3f17019e9f0ccaef75b2dac11d897c4f7 Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Mon, 6 Feb 2023 16:12:37 +0800 Subject: [PATCH] Log versions of all installed packages JIRA: RHELCMP-9493 Signed-off-by: Haibo Lin --- pungi/scripts/pungi_koji.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pungi/scripts/pungi_koji.py b/pungi/scripts/pungi_koji.py index 97db2263..cf8a7f4a 100644 --- a/pungi/scripts/pungi_koji.py +++ b/pungi/scripts/pungi_koji.py @@ -380,6 +380,14 @@ def run_compose( compose.log_info("Current timezone offset: %s" % pungi.util.get_tz_offset()) compose.log_info("COMPOSE_ID=%s" % compose.compose_id) + installed_pkgs_log = compose.paths.log.log_file("global", "installed-pkgs") + compose.log_info("Logging installed packages to %s" % installed_pkgs_log) + try: + with open(installed_pkgs_log, "w") as f: + subprocess.Popen(["rpm", "-qa"], stdout=f) + except Exception as e: + compose.log_warning("Failed to log installed packages: %s" % str(e)) + compose.read_variants() # dump the config file