From 02ca5722f6130de6dbe6b56bebbd2960e8179439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Tue, 17 Sep 2024 13:39:20 +0200 Subject: [PATCH] Solver/dnf.py: simplify the code a bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the `with_sbom` variable was used only in a single place, we can simplify the code (and remove one extra line of it) to just directly use the if condition. Signed-off-by: Tomáš Hozza --- osbuild/solver/dnf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osbuild/solver/dnf.py b/osbuild/solver/dnf.py index a7b726ae..7adbeda8 100755 --- a/osbuild/solver/dnf.py +++ b/osbuild/solver/dnf.py @@ -243,7 +243,6 @@ class DNF(SolverBase): return packages def depsolve(self, arguments): - want_sbom = "sbom" in arguments # Return an empty list when 'transactions' key is missing or when it is None transactions = arguments.get("transactions") or [] # collect repo IDs from the request so we know whether to translate gpg key paths @@ -325,7 +324,7 @@ class DNF(SolverBase): "repos": repositories, } - if want_sbom: + if "sbom" in arguments: response["sbom"] = self._sbom_for_pkgset(last_transaction) return response