diff --git a/files/gvm_library.py b/files/gvm_library.py index 95b5e60146bdd2642b884c0f9682e3167c3d0a50..6472692607d28750e194c050297da98f177690f7 100644 --- a/files/gvm_library.py +++ b/files/gvm_library.py @@ -410,21 +410,19 @@ class Task: self.report_id = task_info.xpath(GVM_XPATH_LAST_REPORT_ID)[0] except Exception: pass - + d = { + "name": self.name, + "status": self.status, + "progress":self.progress, + "in_use":self.in_use, + } + logging.debug(pretty_json(d)) + def wait(self, timeout: int = 7200) -> bool: start_time = time() - retries = self.COMMUNICATION_RETRIES logging.debug("Waiting for scans ends the task") while True: - try: - self.update_status() - except Exception: - if retries > 0: - retries -= 1 - else: - logging.error(f"Collected {self.COMMUNICATION_RETRIES} failures during updating the task status") - return False - + self.update_status() if self.status not in ["New","Requested","Queued","Running","Done"]: # ["Interrupted", ...] logging.warning(f"Task in the undesired status: '{self.status}'") return False