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

Added deployment name in logs

parent 31f4326c
No related branches found
No related tags found
1 merge request!134Added deployment name in logs
Pipeline #166292 passed
......@@ -23,9 +23,6 @@ GVM_XPATH_REPORT_TEXT = 'report/text()'
GVM_STATUS_OK = "200"
GVM_STATUS_CREATE_OK = "201"
# Configiration
COMMUNICATION_RETRIES = 3
# Custom Exceptions
class GvmException(Exception):
pass
......@@ -152,6 +149,9 @@ class Task:
save_report = saves report on file
get_report_info = retrieves report information
"""
# Configiration
COMMUNICATION_RETRIES = 3
def __init__(self,
name: str = "",
......@@ -215,7 +215,7 @@ class Task:
def wait(self, timeout: int = 7200) -> bool:
start_time = time()
retries = COMMUNICATION_RETRIES
retries = self.COMMUNICATION_RETRIES
logging.debug("Waiting for scans ends the task")
while True:
try:
......@@ -224,7 +224,7 @@ class Task:
if retries > 0:
retries -= 1
else:
logging.error("Collected {COMMUNICATION_RETRIES} failures during updating the task status")
logging.error(f"Collected {self.COMMUNICATION_RETRIES} failures during updating the task status")
return False
if self.status not in ["New","Requested","Queued","Running","Done"]: # ["Interrupted", ...]
......
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