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

Reviewed scan python code

parent f484a181
No related branches found
No related tags found
1 merge request!108Updated Python scan code
...@@ -56,7 +56,7 @@ class PortList: ...@@ -56,7 +56,7 @@ class PortList:
self.delete() self.delete()
def delete(self): def delete(self):
print("DELETION...", self) print("DELETION PORTLIST...", self)
print("client pl", self.client) print("client pl", self.client)
res = self.client.delete_port_list(self.id) res = self.client.delete_port_list(self.id)
status = res.xpath('@status')[0] status = res.xpath('@status')[0]
...@@ -100,10 +100,9 @@ class Target: ...@@ -100,10 +100,9 @@ class Target:
def __del__(self): def __del__(self):
self.delete() self.delete()
del self.port_list
def delete(self): def delete(self):
print("DELETION...", self) print("DELETION TARGET ...", self)
res = self.client.delete_target(self.id) res = self.client.delete_target(self.id)
status = res.xpath('@status')[0] status = res.xpath('@status')[0]
status_text = res.xpath('@status_text')[0] status_text = res.xpath('@status_text')[0]
...@@ -111,6 +110,7 @@ class Target: ...@@ -111,6 +110,7 @@ class Target:
logging.info(f"Target {self} DELETED") logging.info(f"Target {self} DELETED")
else: else:
logging.error(f"ERROR during the target deletion {status}: {status_text}") logging.error(f"ERROR during the target deletion {status}: {status_text}")
del self.port_list
class Task: class Task:
""" """
...@@ -170,7 +170,7 @@ class Task: ...@@ -170,7 +170,7 @@ class Task:
logging.info(f"Task {self} STARTED") logging.info(f"Task {self} STARTED")
def delete(self): def delete(self):
print("DELETION...", self) print("DELETION TASK ...", self)
res = self.client.delete_task(self.id) res = self.client.delete_task(self.id)
status = res.xpath('@status')[0] status = res.xpath('@status')[0]
status_text = res.xpath('@status_text')[0] status_text = res.xpath('@status_text')[0]
...@@ -178,10 +178,10 @@ class Task: ...@@ -178,10 +178,10 @@ class Task:
logging.info(f"Task {self} DELETED") logging.info(f"Task {self} DELETED")
else: else:
logging.error(f"ERROR during the task deletion {status}: {status_text}") logging.error(f"ERROR during the task deletion {status}: {status_text}")
del self.target
def __del__(self): def __del__(self):
self.delete() self.delete()
del self.target
def update_status(self): def update_status(self):
tasks_info = self.client.get_tasks(filter_string = self.id) tasks_info = self.client.get_tasks(filter_string = self.id)
......
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