From: Eduardo Sousa Date: Fri, 21 Jun 2019 10:54:56 +0000 (+0100) Subject: Adding support for FsMongo X-Git-Tag: v7.0.0rc1~13 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=5899e08821d446ce8e036aa59a3451487b1bd0b3;p=osm%2FLCM.git Adding support for FsMongo Change-Id: Ied3a67f98e3486d78a366dbcc2c10cd726c41745 Signed-off-by: Eduardo Sousa --- diff --git a/Dockerfile.local b/Dockerfile.local index a905732..7898a84 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -79,8 +79,11 @@ ENV OSMLCM_DATABASE_URI mongodb://mongo:27017 # ENV OSMLCM_DATABASE_PASSWORD xxx #storage -ENV OSMLCM_STORAGE_DRIVER local -ENV OSMLCM_STORAGE_PATH /app/storage +ENV OSMLCM_STORAGE_DRIVER local +ENV OSMLCM_STORAGE_PATH /app/storage +#ENV OSMLCM_STORAGE_DRIVER mongo +#ENV OSMNBI_STORAGE_URI mongodb://mongo:27017 +#ENV OSMLCM_STORAGE_COLLECTION files # message ENV OSMLCM_MESSAGE_DRIVER kafka diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index 3569904..de829bd 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -38,7 +38,7 @@ from time import time, sleep from osm_lcm.lcm_utils import versiontuple, LcmException, TaskRegistry, LcmExceptionExit from osm_lcm import version as lcm_version, version_date as lcm_version_date -from osm_common import dbmemory, dbmongo, fslocal, msglocal, msgkafka +from osm_common import dbmemory, dbmongo, fslocal, fsmongo, msglocal, msgkafka from osm_common import version as common_version from osm_common.dbbase import DbException from osm_common.fsbase import FsException @@ -158,6 +158,9 @@ class Lcm: if config["storage"]["driver"] == "local": self.fs = fslocal.FsLocal() self.fs.fs_connect(config["storage"]) + elif config["storage"]["driver"] == "mongo": + self.fs = fsmongo.FsMongo() + self.fs.fs_connect(config["storage"]) else: raise LcmException("Invalid configuration param '{}' at '[storage]':'driver'".format( config["storage"]["driver"]))