Skip to content

Commit

Permalink
tools: neuvector compliance: handle the case when 'tags' can arrive n…
Browse files Browse the repository at this point in the history
…on-iterable from importer
  • Loading branch information
pna-nca committed Nov 11, 2024
1 parent 171ebf4 commit 63c64ba
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dojo/tools/neuvector_compliance/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def get_asset_item(comp_issue, test):
test_profile = comp_issue.get("profile", "unknown profile")

tags = comp_issue.get("tags", [])
description_tags = []
# for yet unclear reasons 'tags' can arrive as non-iterable
try:
iter(tags)
except TypeError:
description_tags = tags
else:
description_tags = ';'.join(tags)

messages = comp_issue.get("message", [])

nodes = comp_issue.get("nodes", [])
Expand Down Expand Up @@ -205,7 +214,7 @@ def get_asset_item(comp_issue, test):
description=test_description,
severity=test_severity,
mitigation=mitigation,
tags=';'.join(tags),
tags=description_tags,
message="\n".join(messages),
affected_systems=affected_systems,
)
Expand Down

0 comments on commit 63c64ba

Please sign in to comment.