Skip to content
Snippets Groups Projects
Commit e253aed7 authored by Gioacchino Vino's avatar Gioacchino Vino
Browse files

Reviewed code

parent 0751a882
No related branches found
No related tags found
1 merge request!143Debug paas ci
......@@ -141,9 +141,6 @@ class PortList:
'in_use': self.in_use}
return pretty_json(d)
#def __del__(self):
# self.delete()
def delete(self):
logging.debug(f"Deletion port_list {self.name}")
res = self.client.delete_port_list(self.id)
......@@ -253,9 +250,6 @@ class Target:
'host': self.host}
return pretty_json(d)
#def __del__(self):
# self.delete()
def delete(self):
logging.debug(f"Deletion target {self.name}")
res = self.client.delete_target(self.id)
......@@ -408,9 +402,6 @@ class Task:
else:
logging.error(f"ERROR during the task deletion {status}: {status_text}")
#def __del__(self):
# self.delete()
def update_status(self):
task_info = self.client.get_tasks(filter_string = self.id) \
.xpath('task')[0]
......
......@@ -128,6 +128,10 @@ for host,ports in endpoints.items():
else:
reports[host] = {'global': {"severity": -1, "threat": f"Scan Error. task.id: {task.id}"} }
task.delete()
target.delete()
port_list.delete()
reports = process_global_reports_info(reports)
logging.info(pretty_json(reports))
......@@ -135,11 +139,11 @@ logging.info(pretty_json(reports))
with open(summary_filename, "w") as f:
f.write(json.dumps(reports))
for task in tasks:
"""for task in tasks:
task.delete()
for target in targets:
target.delete()
for port_list in port_lists:
port_list.delete()
\ No newline at end of file
port_list.delete()"""
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment