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

Improve log message. #380

Merged
merged 1 commit into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Initialize end_time with create_scan. [#354](https://github.com/greenbone/ospd/pull/354)
- Fix get_count_total(). Accept -1 value set by the server. [#355](https://github.com/greenbone/ospd/pull/355)
- Fix get_count_total(). Consider 0 value set by the server. [#366](https://github.com/greenbone/ospd/pull/366)
- Remove exclude hosts which do not belong to the target for the scan progress calculation. [#377](https://github.com/greenbone/ospd/pull/377)
- Remove exclude hosts which do not belong to the target for the scan progress calculation.
[#377](https://github.com/greenbone/ospd/pull/377)
[#380](https://github.com/greenbone/ospd/pull/380)

[20.8.2]: https://github.com/greenbone/ospd/compare/v20.8.1...ospd-20.08

Expand Down
8 changes: 3 additions & 5 deletions ospd/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,9 @@ def simplify_exclude_host_count(self, scan_id: str) -> int:

if invalid_exc_hosts > 0:
LOGGER.warning(
"Please check the excluded host list. It contains "
"hosts which do not belong to the target. %d hosts were "
"removed from the excluded host list. This warning can be "
"ignored if this was done on purpose.",
invalid_exc_hosts,
"Please check the excluded host list. It contains hosts which "
"do not belong to the target. This warning can be ignored if "
"this was done on purpose (e.g. to exclude specific hostname)."
)

# Set scan_info's excluded simplified to propagate excluded count
Expand Down
6 changes: 2 additions & 4 deletions tests/test_scan_and_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,10 +1267,8 @@ def test_scan_invalid_excluded_hosts(self):

logging.Logger.warning.assert_called_with( # pylint: disable=no-member
"Please check the excluded host list. It contains hosts "
"which do not belong to the target. %d hosts were removed from "
"the excluded host list. This warning can be ignored if this "
"was done on purpose.",
254,
"which do not belong to the target. This warning can be ignored if "
"this was done on purpose (e.g. to exclude specific hostname)."
)

def test_get_scan_progress_xml(self):
Expand Down