From 772edc5393c6ccf01e089bc933a893c106d45864 Mon Sep 17 00:00:00 2001 From: Lance-Drane Date: Tue, 3 Feb 2026 11:46:31 -0500 Subject: [PATCH] #21 - fix MongoDB auth failure if not using admin user Signed-off-by: Lance-Drane --- src/dial_service/mongo_handler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dial_service/mongo_handler.py b/src/dial_service/mongo_handler.py index 60ade2d..931b04b 100644 --- a/src/dial_service/mongo_handler.py +++ b/src/dial_service/mongo_handler.py @@ -36,8 +36,10 @@ def __init__(self, creds: MongoDBCredentials) -> None: username=creds.username, password=creds.password, ) - logger.info(client.admin.command('ping')) - self._mongo_collection = client.get_database(creds.db_name).get_collection('workflows') + db = client.get_database(creds.db_name) + ping_result = db.command('ping') + logger.info(ping_result) + self._mongo_collection = db.get_collection('workflows') # DO THE BELOW INSTEAD IF USING CUSTOM INDEXES INSTEAD # self._mongo_collection.create_index([('workflow_id', ASCENDING)], unique=True)