diff --git a/files/gvm_library.py b/files/gvm_library.py index 733d535eeedfdef41dc68b8d80ae3625540a0eb9..3d26aaa93d4c2c78c1b348da7a8a1a94ed46a745 100644 --- a/files/gvm_library.py +++ b/files/gvm_library.py @@ -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)