From 8621c5ddb969d6f500b0cfb396669ceca5e0e781 Mon Sep 17 00:00:00 2001 From: vakaris_zilius Date: Thu, 9 Jun 2022 09:35:04 +0000 Subject: [PATCH] Island: Fix broken config update statements --- monkey/monkey_island/cc/services/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/services/config.py b/monkey/monkey_island/cc/services/config.py index 2cd025434..afc4742ba 100644 --- a/monkey/monkey_island/cc/services/config.py +++ b/monkey/monkey_island/cc/services/config.py @@ -114,7 +114,7 @@ class ConfigService: @staticmethod def set_config_value(config_key_as_arr, value): mongo_key = ".".join(config_key_as_arr) - mongo.db.config.find_one().update({"$set": {mongo_key: value}}) + mongo.db.config.update({}, {"$set": {mongo_key: value}}) @staticmethod def get_flat_config(should_decrypt=True): @@ -151,7 +151,7 @@ class ConfigService: item_value = encrypt_dict(SENSITIVE_SSH_KEY_FIELDS, item_value) else: item_value = get_datastore_encryptor().encrypt(item_value) - mongo.db.config.find_one().update({"$addToSet": {item_key: item_value}}, upsert=False) + mongo.db.config.update({}, {"$addToSet": {item_key: item_value}}) @staticmethod def creds_add_username(username):