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

Commit

Permalink
Improve log message.
Browse files Browse the repository at this point in the history
Actually, no host is removed from the excluded_hosts list. Just the
amount host is ajusted for the scan progress calculation
The excluded_hosts list can have also vhost, which couldn't be part
of the target.
  • Loading branch information
jjnicola committed Apr 1, 2021
1 parent 175ae2f commit 584abf9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
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

0 comments on commit 584abf9

Please sign in to comment.