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

Commit

Permalink
Add dummy close_scan method to be implemented in the wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Jun 26, 2018
1 parent 5099f8f commit c48ffd4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ospd/ospd.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ def handle_stop_scan_command(self, scan_et):
raise OSPDError('Scan already stopped or finished.', 'stop_scan')

logger.info('{0}: Scan stopping {1}.'.format(scan_id, scan_process.ident))
self.stop_scan(scan_id)
scan_process.terminate()
os.killpg(os.getpgid(scan_process.ident), 15)
scan_process.join()
Expand All @@ -456,6 +457,10 @@ def handle_stop_scan_command(self, scan_et):
logger.info('{0}: Scan stopped.'.format(scan_id))
return simple_response_str('stop_scan', 200, 'OK')

def stop_scan(self, scan_id):
""" Should be implemented by subclass in case of a clean up before
terminating is needed. """

def exec_scan(self, scan_id, target):
""" Asserts to False. Should be implemented by subclass. """
raise NotImplementedError
Expand Down

0 comments on commit c48ffd4

Please sign in to comment.