From fb2f85ba24197a511306249fd777418cb7743bd1 Mon Sep 17 00:00:00 2001 From: vakarisz Date: Thu, 21 Apr 2022 17:36:41 +0300 Subject: [PATCH] Island: Add collection name properties to config and mode models Collection name properties are useful for queries related to these specific collections --- monkey/monkey_island/cc/models/config.py | 3 +++ monkey/monkey_island/cc/models/island_mode_model.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/monkey/monkey_island/cc/models/config.py b/monkey/monkey_island/cc/models/config.py index db5fd9e94..0e25b9ee3 100644 --- a/monkey/monkey_island/cc/models/config.py +++ b/monkey/monkey_island/cc/models/config.py @@ -2,6 +2,9 @@ from mongoengine import BooleanField, EmbeddedDocument class Config(EmbeddedDocument): + + COLLECTION_NAME = "config" + """ No need to define this schema here. It will change often and is already is defined in monkey_island.cc.services.config_schema. diff --git a/monkey/monkey_island/cc/models/island_mode_model.py b/monkey/monkey_island/cc/models/island_mode_model.py index dec93e501..8d6aab74a 100644 --- a/monkey/monkey_island/cc/models/island_mode_model.py +++ b/monkey/monkey_island/cc/models/island_mode_model.py @@ -2,4 +2,6 @@ from mongoengine import Document, StringField class IslandMode(Document): + COLLECTION_NAME = "island_mode" + mode = StringField()