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

Reviewed code

parent 027caa77
No related branches found
No related tags found
1 merge request!142Reviewed code
Pipeline #167994 failed
......@@ -89,7 +89,6 @@ class PortList:
# Search port_lists by id/name
def __get_info(self, filter: str = "rows=-1") -> List[Dict[str, str]]:
res = []
logging.info(f"gvm_client \n {dir(self.client)}")
pls = self.client.get_port_lists(filter_string = filter) \
.xpath('port_list')
......@@ -513,7 +512,10 @@ class GVMClient():
self.client.authenticate(self.auth_name, self.auth_passwd)
logging.debug('GMP Client Authenticated')
def get_client(self):
return self.client
def get_version(self) -> str:
res = self.client.get_version()
return str(res.xpath('version/text()')[0])
......
......@@ -73,10 +73,10 @@ endpoints = import_dep_info(dep_json, args.endpoint_keys)
logging.info(f"endpoints: {endpoints}")
# Create GVM client
gvm_client = GVMClient(auth_n = auth_name, auth_p = auth_passwd)
gvm = GVMClient(auth_n = auth_name, auth_p = auth_passwd)
# Print GVM library version
logging.info(f"gvm version: {gvm_client.get_version()}")
logging.info(f"gvm version: {gvm.get_version()}")
# Retrieve issues irrelevant for INFN
issues_to_drop = read_not_relevant_issues()
......@@ -95,22 +95,20 @@ for host,ports in endpoints.items():
report_filename = f"{output_dir}/{host}-report"
summary_filename = f"{output_dir}/summary-report.json"
logging.info(f"gvm_client \n {gvm_client}")
# Create PortList obj related to endpoint
port_list = PortList(client = gvm_client,
port_list = PortList(client = gvm.get_client(),
name = port_list_name,
ports = ports)
logging.info(f"Port list:\n {port_list}")
# Create Target obj related to endpoint
target = Target(client = gvm_client,
target = Target(client = gvm.get_client(),
name = target_name,
host = host,
port_list =port_list)
logging.info(f"Target:\n {target}")
task = Task(client= gvm_client,
task = Task(client= gvm.get_client(),
name = task_name,
target = target)
logging.info(f"Task:\n {task}")
......
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