From 2f9691b29792bc703d4c9e282aac522179cfa1ee Mon Sep 17 00:00:00 2001 From: Gioacchino Vino <gioacchino.vino@infn.it> Date: Mon, 29 Apr 2024 16:25:05 +0200 Subject: [PATCH] Added logic accepted/know issues during oid validation --- files/gvm_library.py | 4 ---- files/scan.py | 19 +++++++++---------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/files/gvm_library.py b/files/gvm_library.py index b3558c4..8603db7 100644 --- a/files/gvm_library.py +++ b/files/gvm_library.py @@ -489,10 +489,6 @@ class Task: glob_severity = s glob_threat = t report['global'] = {'threat': glob_threat, 'severity': glob_severity} - logging.debug("accepted") - logging.debug(accepted_oids) - logging.debug("new") - logging.debug(new_oids) return report, accepted_oids, new_oids class GVMClient(): diff --git a/files/scan.py b/files/scan.py index b4e9083..6b46cc6 100644 --- a/files/scan.py +++ b/files/scan.py @@ -154,14 +154,13 @@ logging.info(pretty_json(reports)) with open(summary_filename, "w") as f: f.write(json.dumps(reports)) +logging.debug("qwe") +logging.debug(accepted_oids) +logging.debug(new_oids) # Writing oids details on file -if len(accepted_oids) > 1: - with open(oids_filename, "a") as f: - f.write("ACCEPTED OIDs\n") - f.writelines([msg + "\n" for msg in accepted_oids]) - f.write("\n") - -if len(new_oids) > 1: - with open(oids_filename, "a") as f: - f.write("NEW OIDs\n") - f.writelines([msg + "\n" for msg in new_oids]) \ No newline at end of file +with open(oids_filename, "w") as f: + f.write("ACCEPTED OIDs\n") + f.writelines([msg + "\n" for msg in accepted_oids]) + f.write("\n") + f.write("NEW OIDs\n") + f.writelines([msg + "\n" for msg in new_oids]) -- GitLab