diff --git a/ospd/ospd.py b/ospd/ospd.py index 6549ca46..584c39c1 100644 --- a/ospd/ospd.py +++ b/ospd/ospd.py @@ -1188,9 +1188,7 @@ def run(self) -> None: def start_pending_scans(self): for scan_id in self.scan_collection.ids_iterator(): if self.get_scan_status(scan_id) == ScanStatus.PENDING: - scan_target = self.scan_collection.scans_table[scan_id].get( - 'target' - ) + scan_target = self.scan_collection.get_target(scan_id) scan_func = self.start_scan scan_process = create_process( func=scan_func, args=(scan_id, scan_target) diff --git a/ospd/scan.py b/ospd/scan.py index 3df8bb4e..3f1b6532 100644 --- a/ospd/scan.py +++ b/ospd/scan.py @@ -378,6 +378,10 @@ def get_target_options(self, scan_id: str): """ return self.scans_table[scan_id]['target'].get('options') + def get_target(self, scan_id: str) -> Dict: + """ Get the complete target info""" + return self.scans_table[scan_id].get('target') + def get_vts(self, scan_id: str) -> Dict: """ Get a scan's vts. """ scan_info = self.scans_table[scan_id]