Skip to content

Commit

Permalink
Fix create_sbom parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
twaugh committed Sep 11, 2024
1 parent 6bf3c6f commit 9517689
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sbom/examples/container_image/release/from_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def get_rpms(image_id):
return sorted(response.json()["rpms"], key=lambda rpm: rpm["nvra"])


def create_sbom(image_id, root_package, packages, rel_type, other_pkgs=[], other_rels=[]):
relationships = list(other_rels)
def create_sbom(image_id, root_package, packages, rel_type, other_pkgs=None, other_rels=None):
relationships = list(other_rels or [])
relationships.insert(
0,
{
Expand Down Expand Up @@ -67,7 +67,7 @@ def create_sbom(image_id, root_package, packages, rel_type, other_pkgs=[], other
},
"name": image_id,
"documentNamespace": f"https://www.redhat.com/{image_id}.spdx.json",
"packages": [root_package] + packages + other_pkgs,
"packages": [root_package] + packages + (other_pkgs or []),
"relationships": relationships,
}

Expand Down

0 comments on commit 9517689

Please sign in to comment.