Solver/dnf.py: simplify the code a bit
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 <thozza@redhat.com>
This commit is contained in:
parent
9510e88c0f
commit
02ca5722f6
1 changed files with 1 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue