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

Commit

Permalink
Use logger instead of LOGGER.
Browse files Browse the repository at this point in the history
Also, update changelog
  • Loading branch information
jjnicola committed Oct 13, 2021
1 parent 866ea24 commit 8a36506
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Removed
### Fixed
- Fix resume scan. [#464](https://github.com/greenbone/ospd/pull/464)

- Fix get_status. Backport #471.[#472](https://github.com/greenbone/ospd/pull/472)

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

Expand Down
10 changes: 3 additions & 7 deletions ospd/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,12 @@ def set_status(self, scan_id: str, status: ScanStatus) -> None:
self.scans_table[scan_id]['end_time'] = int(time.time())

def get_status(self, scan_id: str) -> ScanStatus:
<<<<<<< HEAD
"""Get scan_id scans's status."""
=======
""" Get scan_id scans's status."""
status = None
try:
status = self.scans_table[scan_id].get('status')
except KeyError:
LOGGER.error("Scan ID %s not found", scan_id)
>>>>>>> a682e99 (Fix: Fix get_status (#471))
logger.error("Scan ID %s not found", scan_id)

return status

Expand Down Expand Up @@ -434,7 +430,7 @@ def simplify_exclude_host_count(self, scan_id: str) -> int:
Count of excluded host.
"""
exc_hosts_list = target_str_to_list(self.get_exclude_hosts(scan_id))
LOGGER.debug(
logger.debug(
'%s: Excluded Hosts: %s',
scan_id,
pformat(exc_hosts_list),
Expand All @@ -443,7 +439,7 @@ def simplify_exclude_host_count(self, scan_id: str) -> int:
finished_hosts_list = target_str_to_list(
self.get_finished_hosts(scan_id)
)
LOGGER.debug(
logger.debug(
'%s: Finished Hosts: %s',
scan_id,
pformat(finished_hosts_list),
Expand Down

0 comments on commit 8a36506

Please sign in to comment.