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

Commit

Permalink
Merge pull request #464 from jjnicola/delete-scan
Browse files Browse the repository at this point in the history
Fix resume task.
  • Loading branch information
ArnoStiefvater committed Oct 12, 2021
2 parents f5c6222 + d4bf472 commit 57be2f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Deprecated
### Removed
### Fixed
- Fix resume scan. [#464](https://github.com/greenbone/ospd/pull/464)


[Unreleased]: https://github.com/greenbone/ospd/compare/v21.4.3...HEAD

Expand Down
12 changes: 11 additions & 1 deletion ospd/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,17 @@ def get_end_time(self, scan_id: str) -> str:
def get_host_list(self, scan_id: str) -> Dict:
""" Get a scan's host list. """

return self.scans_table[scan_id]['target'].get('hosts')
target = None
try:
target = self.scans_table[scan_id]['target'].get('hosts')
except KeyError:
LOGGER.warning(
'%s: Scan ID is in the scan table, but it was '
'not initialized.',
scan_id,
)

return target

def get_host_count(self, scan_id: str) -> int:
""" Get total host count in the target. """
Expand Down

0 comments on commit 57be2f8

Please sign in to comment.