forked from p15670423/monkey
island: Rename MongoDbRunner -> MongoDbProcess
This commit is contained in:
parent
28a34a4ec9
commit
d35099fa9b
|
@ -13,7 +13,7 @@ DB_DIR_PARAM = "--dbpath"
|
||||||
MONGO_LOG_FILENAME = "mongo_log.txt"
|
MONGO_LOG_FILENAME = "mongo_log.txt"
|
||||||
|
|
||||||
|
|
||||||
class MongoDbRunner:
|
class MongoDbProcess:
|
||||||
def __init__(self, db_dir_parent_path: str, logging_dir_path: str):
|
def __init__(self, db_dir_parent_path: str, logging_dir_path: str):
|
||||||
"""
|
"""
|
||||||
@param db_dir_parent_path: Path where a folder for database contents will be created
|
@param db_dir_parent_path: Path where a folder for database contents will be created
|
||||||
|
@ -35,7 +35,7 @@ class MongoDbRunner:
|
||||||
def _start_mongodb_process(self, db_dir_path: str):
|
def _start_mongodb_process(self, db_dir_path: str):
|
||||||
logger.info("Starting MongoDb process.")
|
logger.info("Starting MongoDb process.")
|
||||||
|
|
||||||
mongo_run_cmd = MongoDbRunner._build_mongo_launch_cmd(MONGO_EXECUTABLE_PATH, db_dir_path)
|
mongo_run_cmd = MongoDbProcess._build_mongo_launch_cmd(MONGO_EXECUTABLE_PATH, db_dir_path)
|
||||||
logger.info(f"Mongodb will be launched with command: {' '.join(mongo_run_cmd)}.")
|
logger.info(f"Mongodb will be launched with command: {' '.join(mongo_run_cmd)}.")
|
||||||
|
|
||||||
mongo_log_path = os.path.join(self.logging_dir_path, MONGO_LOG_FILENAME)
|
mongo_log_path = os.path.join(self.logging_dir_path, MONGO_LOG_FILENAME)
|
|
@ -6,7 +6,7 @@ import time
|
||||||
from monkey_island.cc.database import get_db_version, is_db_server_up
|
from monkey_island.cc.database import get_db_version, is_db_server_up
|
||||||
from monkey_island.cc.setup.mongo import mongo_connector
|
from monkey_island.cc.setup.mongo import mongo_connector
|
||||||
from monkey_island.cc.setup.mongo.mongo_connector import MONGO_DB_HOST, MONGO_DB_NAME, MONGO_DB_PORT
|
from monkey_island.cc.setup.mongo.mongo_connector import MONGO_DB_HOST, MONGO_DB_NAME, MONGO_DB_PORT
|
||||||
from monkey_island.cc.setup.mongo.mongo_process_runner import MongoDbRunner
|
from monkey_island.cc.setup.mongo.mongo_db_process import MongoDbProcess
|
||||||
from monkey_island.setup.island_config_options import IslandConfigOptions
|
from monkey_island.setup.island_config_options import IslandConfigOptions
|
||||||
|
|
||||||
MONGO_URL = os.environ.get(
|
MONGO_URL = os.environ.get(
|
||||||
|
@ -20,7 +20,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
def start_mongodb(config_options: IslandConfigOptions):
|
def start_mongodb(config_options: IslandConfigOptions):
|
||||||
if config_options.start_mongodb:
|
if config_options.start_mongodb:
|
||||||
MongoDbRunner(
|
MongoDbProcess(
|
||||||
db_dir_parent_path=config_options.data_dir, logging_dir_path=config_options.data_dir
|
db_dir_parent_path=config_options.data_dir, logging_dir_path=config_options.data_dir
|
||||||
).launch_mongodb()
|
).launch_mongodb()
|
||||||
wait_for_mongo_db_server(MONGO_URL)
|
wait_for_mongo_db_server(MONGO_URL)
|
||||||
|
|
Loading…
Reference in New Issue