diff --git a/monkey/monkey_island/cc/environment/utils.py b/monkey/monkey_island/cc/environment/utils.py index cbb8a1d6f..585b2cc79 100644 --- a/monkey/monkey_island/cc/environment/utils.py +++ b/monkey/monkey_island/cc/environment/utils.py @@ -1,5 +1,5 @@ -import sys +import platform def is_windows_os() -> bool: - return sys.platform.startswith("win") + return platform.system() == "Windows" diff --git a/monkey/monkey_island/cc/server_utils/common_methods.py b/monkey/monkey_island/cc/server_utils/common_methods.py deleted file mode 100644 index 218f146ed..000000000 --- a/monkey/monkey_island/cc/server_utils/common_methods.py +++ /dev/null @@ -1,11 +0,0 @@ -import platform - -WINDOWS = "Windows" -LINUX = "Linux" - - -def get_runtime_os() -> str: - if platform.system() == "Windows": - return WINDOWS - else: - return LINUX diff --git a/monkey/monkey_island/cc/setup/mongo_process_runner.py b/monkey/monkey_island/cc/setup/mongo_process_runner.py index bc429479e..71d3e6c81 100644 --- a/monkey/monkey_island/cc/setup/mongo_process_runner.py +++ b/monkey/monkey_island/cc/setup/mongo_process_runner.py @@ -3,7 +3,7 @@ import os import subprocess from typing import List -from monkey_island.cc.server_utils.common_methods import WINDOWS, get_runtime_os +from monkey_island.cc.environment.utils import is_windows_os from monkey_island.cc.server_utils.consts import ( MONGO_EXECUTABLE_PATH_LINUX, MONGO_EXECUTABLE_PATH_WIN, @@ -53,7 +53,7 @@ class MongoDbRunner: @staticmethod def _get_path_of_mongo_exec(): - if get_runtime_os() == WINDOWS: + if is_windows_os(): return MONGO_EXECUTABLE_PATH_WIN else: return MONGO_EXECUTABLE_PATH_LINUX