forked from p15670423/monkey
cc: remove unnecessary `config` property from environment_singleton
Introduced in b0d478473fe
This commit is contained in:
parent
b5e8d895c8
commit
1fad6b4666
|
@ -20,7 +20,6 @@ ENV_DICT = {
|
||||||
}
|
}
|
||||||
|
|
||||||
env = None
|
env = None
|
||||||
config = None
|
|
||||||
|
|
||||||
|
|
||||||
def set_env(env_type: str, env_config: EnvironmentConfig):
|
def set_env(env_type: str, env_config: EnvironmentConfig):
|
||||||
|
@ -40,8 +39,6 @@ def set_to_standard():
|
||||||
|
|
||||||
|
|
||||||
def initialize_from_file(file_path):
|
def initialize_from_file(file_path):
|
||||||
global config
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
config = EnvironmentConfig(file_path)
|
config = EnvironmentConfig(file_path)
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ MINIMUM_MONGO_DB_VERSION_REQUIRED = "4.2.0"
|
||||||
def main(should_setup_only=False, server_config_filename=DEFAULT_SERVER_CONFIG_PATH):
|
def main(should_setup_only=False, server_config_filename=DEFAULT_SERVER_CONFIG_PATH):
|
||||||
logger.info("Starting bootloader server")
|
logger.info("Starting bootloader server")
|
||||||
env_singleton.initialize_from_file(server_config_filename)
|
env_singleton.initialize_from_file(server_config_filename)
|
||||||
initialize_encryptor(env_singleton.config.data_dir_abs_path)
|
initialize_encryptor(env_singleton.env.get_config().data_dir_abs_path)
|
||||||
|
|
||||||
mongo_url = os.environ.get('MONGO_URL', env_singleton.env.get_mongo_url())
|
mongo_url = os.environ.get('MONGO_URL', env_singleton.env.get_mongo_url())
|
||||||
bootloader_server_thread = Thread(target=BootloaderHttpServer(mongo_url).serve_forever, daemon=True)
|
bootloader_server_thread = Thread(target=BootloaderHttpServer(mongo_url).serve_forever, daemon=True)
|
||||||
|
|
|
@ -32,7 +32,7 @@ def run_local_monkey():
|
||||||
return False, "OS Type not found"
|
return False, "OS Type not found"
|
||||||
|
|
||||||
monkey_path = os.path.join(MONKEY_ISLAND_ABS_PATH, 'cc', 'binaries', result['filename'])
|
monkey_path = os.path.join(MONKEY_ISLAND_ABS_PATH, 'cc', 'binaries', result['filename'])
|
||||||
target_path = os.path.join(env_singleton.config.data_dir_abs_path, result['filename'])
|
target_path = os.path.join(env_singleton.env.get_config().data_dir_abs_path, result['filename'])
|
||||||
|
|
||||||
# copy the executable to temp path (don't run the monkey from its current location as it may delete itself)
|
# copy the executable to temp path (don't run the monkey from its current location as it may delete itself)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue