Skip to content

Commit a7a56c4

Browse files
author
Jakob Maier
committed
removed replaced code
1 parent 601aaf0 commit a7a56c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/client/get_project_vulnerabilites_as_csv.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
level=logging.DEBUG,
2626
format="[%(asctime)s] {%(module)s:%(lineno)d} %(levelname)s - %(message)s"
2727
)
28+
def strip_newline(str):
29+
return str.replace('\r', '').replace('\n', '')
2830

2931
def main():
3032
program_name = os.path.basename(sys.argv[0])
@@ -67,8 +69,8 @@ def main():
6769

6870
status = remediation['remediationStatus']
6971
identifier = remediation['vulnerabilityName']
70-
description = remediation['description'].replace('\r', '').replace('\n', '')
71-
comment = remediation.get('remediationComment', "").replace('\r', '').replace('\n', '')
72+
description = strip_newline(remediation['description'])
73+
comment = strip_newline(remediation.get('remediationComment', ""))
7274

7375
row = [identifier, status, comment, componentName, componentVersion, description]
7476
csv_writer.writerow(row)

0 commit comments

Comments
 (0)