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

Commit

Permalink
Don't access 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 00f51a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add [pontos](https://github.com/greenbone/pontos) as dev dependency for
managing the version information in ospd [#254](https://github.com/greenbone/ospd/pull/254)
- Add more info about scan progress with progress attribute in get_scans cmd. [#266](https://github.com/greenbone/ospd/pull/266)
- Add method to get complete target info [#275](https://github.com/greenbone/ospd/pull/275)

### Changes
- Modify __init__() method and use new syntax for super(). [#186](https://github.com/greenbone/ospd/pull/186)
Expand Down
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 00f51a3

Please sign in to comment.