From 14cbf07a21fac2dc0e2e6be843224e8d9aaaed3d Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 11 Jul 2022 09:02:57 -0400 Subject: [PATCH] Island: Register mongo client as instance, not convention --- monkey/monkey_island/cc/services/initialize.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/services/initialize.py b/monkey/monkey_island/cc/services/initialize.py index 5c951eca3..d51383132 100644 --- a/monkey/monkey_island/cc/services/initialize.py +++ b/monkey/monkey_island/cc/services/initialize.py @@ -44,7 +44,10 @@ AGENT_BINARIES_PATH = Path(MONKEY_ISLAND_ABS_PATH) / "cc" / "binaries" def initialize_services(data_dir: Path) -> DIContainer: container = DIContainer() _register_conventions(container, data_dir) + container.register_instance(AWSInstance, AWSInstance()) + container.register_instance(MongoClient, MongoClient(MONGO_URL, serverSelectionTimeoutMS=100)) + _register_repositories(container, data_dir) _register_services(container) @@ -66,9 +69,6 @@ def _register_conventions(container: DIContainer, data_dir: Path): "default_ransomware_agent_configuration", DEFAULT_RANSOMWARE_AGENT_CONFIGURATION, ) - container.register_convention( - MongoClient, "mongo", MongoClient(MONGO_URL, serverSelectionTimeoutMS=100) - ) def _register_repositories(container: DIContainer, data_dir: Path):