Skip to content

Commit

Permalink
Fix: Handle missing excerpt in notes / overrides.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelmold authored and timopollmeier committed Jan 29, 2024
1 parent 1d4aea5 commit 632239d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pheme/transformation/scanreport/gvmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,12 @@ def per_result(result):

def per_note(note):
result_notes = new_host_result.get("notes", [])
excerpt = "0"
if "excerpt" in note["text"] :
excerpt = note["text"]["excerpt"]
new_note = {
"text": note["text"]["text"],
"text_excerpt": note["text"]["excerpt"],
"text_excerpt": excerpt,
}
result_notes.append(new_note)

Expand All @@ -265,9 +268,12 @@ def per_override(override):
elif float(severity) > 0.0:
severity_description = "Any positive severity"

excerpt = "0"
if "excerpt" in override["text"] :
excerpt = override["text"]["excerpt"]
new_override = {
"text": override["text"]["text"],
"text_excerpt": override["text"]["excerpt"],
"text_excerpt": excerpt,
"severity": severity,
"severity_description": severity_description,
"new_severity": override["new_severity"],
Expand Down

0 comments on commit 632239d

Please sign in to comment.