diff --git a/monkey/common/utils/mongo_utils.py b/monkey/common/utils/mongo_utils.py index 854109b30..4c5a7f669 100644 --- a/monkey/common/utils/mongo_utils.py +++ b/monkey/common/utils/mongo_utils.py @@ -1,5 +1,7 @@ -import wmi -import win32com +import sys +if sys.platform == 'win32': + import win32com + import wmi __author__ = 'maor.rayzin' diff --git a/monkey/common/utils/reg_utils.py b/monkey/common/utils/reg_utils.py deleted file mode 100644 index fad92df5e..000000000 --- a/monkey/common/utils/reg_utils.py +++ /dev/null @@ -1,25 +0,0 @@ -import winreg - -from common.utils.mongo_utils import MongoUtils - -__author__ = 'maor.rayzin' - - -class RegUtils: - - def __init__(self): - # Static class - pass - - @staticmethod - def get_reg_key(subkey_path, store=winreg.HKEY_LOCAL_MACHINE): - key = winreg.ConnectRegistry(None, store) - subkey = winreg.OpenKey(key, subkey_path) - - d = dict([winreg.EnumValue(subkey, i)[:2] for i in range(winreg.QueryInfoKey(subkey)[0])]) - d = MongoUtils.fix_obj_for_mongo(d) - - subkey.Close() - key.Close() - - return d diff --git a/monkey/infection_monkey/requirements.txt b/monkey/infection_monkey/requirements.txt index fe72d1ee0..7cbb5369f 100644 --- a/monkey/infection_monkey/requirements.txt +++ b/monkey/infection_monkey/requirements.txt @@ -13,7 +13,7 @@ ipaddress # See breaking change here: https://github.com/tjguk/wmi/commit/dcf8e3eca79bb8c0101ffb83e25c066b0ba9e16d # Causes pip to error with: # Could not find a version that satisfies the requirement pywin32 (from wmi->-r /src/infection_monkey/requirements.txt (line 12)) (from versions: none) -wmi==1.4.9 +wmi==1.4.9 ; sys_platform == 'win32' pymssql<3.0 pyftpdlib WinSys-3.x