diff --git a/ospd/ospd.py b/ospd/ospd.py index e64fdcbb..36ffc3b4 100644 --- a/ospd/ospd.py +++ b/ospd/ospd.py @@ -595,7 +595,7 @@ def start_scan(self, scan_id: str) -> None: self.finish_scan(scan_id) elif not is_stopped: logger.info( - "%s: Host scan finished. Progress: %d, " "Status: %s", + "%s: Host scan finished. Progress: %d, Status: %s", scan_id, progress, status.name, @@ -710,7 +710,8 @@ def get_scan_status(self, scan_id: str) -> ScanStatus: def scan_exists(self, scan_id: str) -> bool: """Checks if a scan with ID scan_id is in collection. - @return: 1 if scan exists, 0 otherwise. + Return: + 1 if scan exists, 0 otherwise. """ return self.scan_collection.id_exists(scan_id) @@ -753,7 +754,8 @@ def elements_as_text(self, elems: Dict, indent: int = 2) -> str: def delete_scan(self, scan_id: str) -> int: """Deletes scan_id scan from collection. - @return: 1 if scan deleted, 0 otherwise. + Return: + 1 if scan deleted, 0 otherwise. """ if self.get_scan_status(scan_id) == ScanStatus.RUNNING: return 0 @@ -776,7 +778,8 @@ def get_scan_results_xml( ): """Gets scan_id scan's results in XML format. - @return: String of scan results in xml. + Return: + String of scan results in xml. """ results = Element('results') for result in self.scan_collection.results_iterator( @@ -818,7 +821,8 @@ def _get_scan_progress_raw(self, scan_id: str) -> Dict: def _get_scan_progress_xml(self, scan_id: str): """Gets scan_id scan's progress in XML format. - @return: String of scan progress in xml. + Return: + String of scan progress in xml. """ current_progress = self._get_scan_progress_raw(scan_id) return get_progress_xml(current_progress) @@ -830,9 +834,11 @@ def _get_scan_progress_xml(self, scan_id: str): def get_xml_str(self, data: Dict) -> List: """Creates a string in XML Format using the provided data structure. - @param: Dictionary of xml tags and their elements. + Arguments: + data: Dictionary of xml tags and their elements. - @return: String of data in xml format. + Return: + String of data in xml format. """ return get_elements_from_dict(data) @@ -846,7 +852,8 @@ def get_scan_xml( ): """Gets scan in XML format. - @return: String of scan in XML format. + Return: + String of scan in XML format. """ if not scan_id: return Element('scan') @@ -899,7 +906,8 @@ def get_custom_vt_as_xml_str( # pylint: disable=unused-argument The custom XML object which is returned will be embedded into a element. - @return: XML object as string for custom data. + Return: + XML object as string for custom data. """ return '' @@ -915,7 +923,8 @@ def get_params_vt_as_xml_str( # pylint: disable=unused-argument The params XML object which is returned will be embedded into a element. - @return: XML object as string for vt parameters data. + Return: + XML object as string for vt parameters data. """ return '' @@ -931,7 +940,8 @@ def get_refs_vt_as_xml_str( # pylint: disable=unused-argument The refs XML object which is returned will be embedded into a element. - @return: XML object as string for vt references data. + Return: + XML object as string for vt references data. """ return '' @@ -947,7 +957,8 @@ def get_dependencies_vt_as_xml_str( # pylint: disable=unused-argument The vt_dependencies XML object which is returned will be embedded into a element. - @return: XML object as string for vt dependencies data. + Return: + XML object as string for vt dependencies data. """ return '' @@ -963,7 +974,8 @@ def get_creation_time_vt_as_xml_str( # pylint: disable=unused-argument The vt_creation_time XML object which is returned will be embedded into a element. - @return: XML object as string for vt creation time data. + Return: + XML object as string for vt creation time data. """ return '' @@ -979,7 +991,8 @@ def get_modification_time_vt_as_xml_str( # pylint: disable=unused-argument The vt_modification_time XML object which is returned will be embedded into a element. - @return: XML object as string for vt references data. + Return: + XML object as string for vt references data. """ return '' @@ -995,7 +1008,8 @@ def get_summary_vt_as_xml_str( # pylint: disable=unused-argument The summary XML object which is returned will be embedded into a element. - @return: XML object as string for summary data. + Return: + XML object as string for summary data. """ return '' @@ -1011,7 +1025,8 @@ def get_impact_vt_as_xml_str( # pylint: disable=unused-argument The impact XML object which is returned will be embedded into a element. - @return: XML object as string for impact data. + Return: + XML object as string for impact data. """ return '' @@ -1027,7 +1042,8 @@ def get_affected_vt_as_xml_str( # pylint: disable=unused-argument The affected XML object which is returned will be embedded into a element. - @return: XML object as string for affected data. + Return: + XML object as string for affected data. """ return '' @@ -1043,7 +1059,8 @@ def get_insight_vt_as_xml_str( # pylint: disable=unused-argument The insight XML object which is returned will be embedded into a element. - @return: XML object as string for insight data. + Return: + XML object as string for insight data. """ return '' @@ -1059,7 +1076,8 @@ def get_solution_vt_as_xml_str( # pylint: disable=unused-argument The solution XML object which is returned will be embedded into a element. - @return: XML object as string for solution data. + Return: + XML object as string for solution data. """ return '' @@ -1075,7 +1093,8 @@ def get_detection_vt_as_xml_str( # pylint: disable=unused-argument The detection XML object which is returned is an element with tag element - @return: XML object as string for detection data. + Return: + XML object as string for detection data. """ return '' @@ -1091,7 +1110,8 @@ def get_severities_vt_as_xml_str( # pylint: disable=unused-argument The severities XML objects which are returned will be embedded into a element. - @return: XML object as string for severities data. + Return: + XML object as string for severities data. """ return '' @@ -1105,7 +1125,8 @@ def get_vt_iterator( # pylint: disable=unused-argument def get_vt_xml(self, single_vt: Tuple[str, Dict]) -> Element: """Gets a single vulnerability test information in XML format. - @return: String of single vulnerability test information in XML format. + Return: + String of single vulnerability test information in XML format. """ if not single_vt or single_vt[1] is None: return Element('vt') @@ -1406,11 +1427,13 @@ def create_scan( ) -> Optional[str]: """Creates a new scan. - @target: Target to scan. - @options: Miscellaneous scan options supplied via + Arguments: + target: Target to scan. + options: Miscellaneous scan options supplied via XML element. - @return: New scan's ID. None if the scan_id already exists. + Return: + New scan's ID. None if the scan_id already exists. """ status = None scan_exists = self.scan_exists(scan_id)