diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 9b36ba59e..294381696 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -23,6 +23,7 @@ from infection_monkey.telemetry.messengers.legacy_telemetry_messenger_adapter im from infection_monkey.telemetry.state_telem import StateTelem from infection_monkey.telemetry.tunnel_telem import TunnelTelem from infection_monkey.utils.environment import is_windows_os +from infection_monkey.utils.exceptions.planned_shutdown_error import PlannedShutdownError from infection_monkey.utils.monkey_dir import get_monkey_dir_path, remove_monkey_dir from infection_monkey.utils.monkey_log_path import get_monkey_log_path from infection_monkey.utils.signal_handler import register_signal_handlers diff --git a/monkey/infection_monkey/utils/exceptions/planned_shutdown_error.py b/monkey/infection_monkey/utils/exceptions/planned_shutdown_error.py new file mode 100644 index 000000000..885340c23 --- /dev/null +++ b/monkey/infection_monkey/utils/exceptions/planned_shutdown_error.py @@ -0,0 +1,2 @@ +class PlannedShutdownError(Exception): + pass diff --git a/monkey/infection_monkey/utils/signal_handler.py b/monkey/infection_monkey/utils/signal_handler.py index 87d965398..6fda3bc12 100644 --- a/monkey/infection_monkey/utils/signal_handler.py +++ b/monkey/infection_monkey/utils/signal_handler.py @@ -3,7 +3,7 @@ import signal from infection_monkey.i_master import IMaster from infection_monkey.utils.environment import is_windows_os -from infection_monkey.utils.exceptions.planned_shutdown_exception import PlannedShutdownException +from infection_monkey.utils.exceptions.planned_shutdown_error import PlannedShutdownError logger = logging.getLogger(__name__) @@ -16,7 +16,7 @@ class StopSignalHandler: self._handle_signal(signum) # Windows signal handlers must return boolean. Only raising this exception for POSIX # signals. - raise PlannedShutdownException("Monkey Agent got an interrupt signal") + raise PlannedShutdownError("Monkey Agent got an interrupt signal") def handle_windows_signals(self, signum): import win32con