Docs, Tests, SIGINT
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import click
|
||||
import signal
|
||||
import sys
|
||||
from importlib.metadata import version
|
||||
from overseer.config import EnvConfig
|
||||
from overseer.scanner import ScanManager
|
||||
@@ -14,6 +16,11 @@ database = DatabaseConnector(config.DATA_PATH)
|
||||
scan_manager = ScanManager()
|
||||
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
scan_manager.shutdown()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def create_app():
|
||||
return app
|
||||
|
||||
@@ -23,5 +30,8 @@ def cli():
|
||||
"""Management script for the application."""
|
||||
|
||||
|
||||
# Handle SIGINT
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
# Import all flask views
|
||||
import overseer.overseer # noqa: E501,F401,E402
|
||||
|
||||
@@ -73,6 +73,11 @@ class DatabaseConnector:
|
||||
**kwargs
|
||||
Either hostname or ip_addr
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError
|
||||
If hostname or ip_addr isn't provided in kwargs
|
||||
|
||||
Returns
|
||||
-------
|
||||
ScanTarget
|
||||
@@ -103,6 +108,11 @@ class DatabaseConnector:
|
||||
**kwargs
|
||||
Either hostname or ip_addr
|
||||
|
||||
Raises
|
||||
------
|
||||
ValueError
|
||||
If hostname or ip_addr isn't provided in kwargs
|
||||
|
||||
Returns
|
||||
-------
|
||||
ScanTarget
|
||||
@@ -196,6 +206,11 @@ class DatabaseConnector:
|
||||
error : str, optional
|
||||
Error message, if any
|
||||
|
||||
Raises
|
||||
------
|
||||
NoResultFound
|
||||
If we cannot find the desired ScanHistory by ID
|
||||
|
||||
Returns
|
||||
-------
|
||||
ScanHistory
|
||||
|
||||
Reference in New Issue
Block a user