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

Improved get_task function

parent 1221eb30
No related branches found
No related tags found
1 merge request!129Improved get_task function
......@@ -444,7 +444,7 @@ class GVMClient():
t.status = task.xpath('status/text()')[0]
try:
t.report_id = task.xpath('last_report/report/@id')[0]
except:
except Exception:
pass
list_of_tasks.append(t)
return list_of_tasks
......@@ -457,8 +457,8 @@ class GVMClient():
res[0].target = target
return res[0]
else:
print(f"Found {len(res)} results. Return None")
return res
print(f"WARNING: Returned {len(res)} tasks. Returned None")
return res[0]
def delete_all_tasks(self, filter: str):
tasks = self.get_tasks(filter)
......
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