Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Commit

Permalink
Dont ccess scan info directly
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed May 19, 2020
1 parent 54fe4da commit bb07fbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions ospd/ospd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions ospd/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit bb07fbe

Please sign in to comment.