Skip to content

Commit b1ea6c8

Browse files
Thomas1415manni83
authored andcommitted
Preserve newline character in remediation comments fields.
1 parent 37a19c0 commit b1ea6c8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/client/get_project_vulnerabilites_as_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
)
2828

2929
def strip_newline(str):
30-
return str.replace('\r', '').replace('\n', ' ')
30+
return str.replace('\r', '').replace('\n', '\\n')
3131

3232
def match_component(selected_components, component):
3333
if (len(selected_components) == 0):

examples/vuln_batch_remediation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def set_vulnerablity_remediation(hub, vuln, remediation_status, remediation_comm
127127
url = vuln['_meta']['href']
128128
update={}
129129
update['remediationStatus'] = remediation_status
130-
update['comment'] = remediation_comment
130+
update['comment'] = remediation_comment.replace('\\n','\n')
131131
response = hub.execute_put(url, data=update)
132132
return response
133133

@@ -283,4 +283,4 @@ def main(argv=None): # IGNORE:C0111
283283
return 0
284284

285285
if __name__ == "__main__":
286-
sys.exit(main())
286+
sys.exit(main())

0 commit comments

Comments
 (0)