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 #432 from Kraemii/improve-structure
Browse files Browse the repository at this point in the history
Improve structure
  • Loading branch information
jjnicola committed Jul 8, 2021
2 parents 2003ce2 + f30eab7 commit 0fc71e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed
- Set Log Timestamp to UTC. [#394](https://github.com/greenbone/ospd-openvas/pull/394)
- Stopping scan. [#432](https://github.com/greenbone/ospd/pull/432)

### Fixed
### Removed
Expand Down
14 changes: 1 addition & 13 deletions ospd/ospd.py
Expand Up @@ -357,8 +357,6 @@ def stop_scan(self, scan_id: str) -> None:
'%s: Stopping Scan with the PID %s.', scan_id, scan_process.ident
)

self.stop_scan_cleanup(scan_id)

try:
scan_process.terminate()
except AttributeError:
Expand All @@ -381,16 +379,6 @@ def stop_scan(self, scan_id: str) -> None:

logger.info('%s: Scan stopped.', scan_id)

@staticmethod
def stop_scan_cleanup(scan_id: str):
"""Should be implemented by subclass in case of a clean up before
terminating is needed."""

@staticmethod
def target_is_finished(scan_id: str):
"""Should be implemented by subclass in case of a check before
stopping is needed."""

def exec_scan(self, scan_id: str):
"""Asserts to False. Should be implemented by subclass."""
raise NotImplementedError
Expand Down Expand Up @@ -558,7 +546,7 @@ def start_scan(self, scan_id: str) -> None:
self.finish_scan(scan_id)
elif not is_stopped:
logger.info(
"%s: Host scan finished. Progress: %d, Status: %s",
"%s: Host scan got interrupted. Progress: %d, Status: %s",
scan_id,
progress,
status.name,
Expand Down

0 comments on commit 0fc71e2

Please sign in to comment.