Agent: rename PlannedShutdownException to PlannedShutdownError

This will stay consistent with python and our own codebase
This commit is contained in:
VakarisZ 2021-12-01 12:49:11 +02:00
parent 89436a4cd9
commit 0806afed1a
3 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -0,0 +1,2 @@
class PlannedShutdownError(Exception):
pass

View File

@ -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