From: lavado Date: Tue, 20 Nov 2018 14:10:37 +0000 (+0200) Subject: Revert "Adds use of uri in connection to MongoDB instead of host and port" X-Git-Tag: v5.0.0~10 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F22%2F6922%2F1;p=osm%2FMON.git Revert "Adds use of uri in connection to MongoDB instead of host and port" This reverts commit 2fa92533799dcac2fbb47db2e06579e951294e6a. Change-Id: Ief2dc8eb49577c9321b34f67efa5296edc281056 --- diff --git a/docker/Dockerfile b/docker/Dockerfile index f843908..ec70d87 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -37,7 +37,7 @@ COPY . /mon RUN pip3 install /mon ENV BROKER_URI kafka:9092 -ENV MONGO_URI mongodb://mongo:27017 +ENV MONGO_URI mongo:27017 ENV DATABASE sqlite:///mon_sqlite.db ENV OS_NOTIFIER_URI localhost:8662 ENV OS_DEFAULT_GRANULARITY 300 diff --git a/osm_mon/core/common_db.py b/osm_mon/core/common_db.py index 075f9d5..5a76536 100644 --- a/osm_mon/core/common_db.py +++ b/osm_mon/core/common_db.py @@ -30,7 +30,8 @@ class CommonDbClient: def __init__(self): cfg = Config.instance() self.common_db = dbmongo.DbMongo() - self.common_db.db_connect({'uri': cfg.MONGO_URI.split, + self.common_db.db_connect({'host': cfg.MONGO_URI.split(':')[0], + 'port': int(cfg.MONGO_URI.split(':')[1]), 'name': 'osm', 'commonkey': cfg.OSMMON_DATABASE_COMMONKEY})