X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fcommon.git;a=blobdiff_plain;f=osm_common%2Fdbmongo.py;h=6159e6a3a306670258ef24d425562a9700740886;hp=0f89c96cad130eab869ac442ec35f5e8f115aecc;hb=89e933d55a1bcaabfed140d09aea97d90df9398d;hpb=eef7cb7a4f704bf0d29e6d8ece5195dc3faabb69 diff --git a/osm_common/dbmongo.py b/osm_common/dbmongo.py index 0f89c96..6159e6a 100644 --- a/osm_common/dbmongo.py +++ b/osm_common/dbmongo.py @@ -80,7 +80,10 @@ class DbMongo(DbBase): master_key = config.get("commonkey") or config.get("masterpassword") if master_key: self.set_secret_key(master_key) - self.client = MongoClient(config["host"], config["port"]) + if config.get("url"): + self.client = MongoClient(config["url"]) + else: + self.client = MongoClient(config["host"], config["port"]) # TODO add as parameters also username=config.get("user"), password=config.get("password")) # when all modules are ready self.db = self.client[config["name"]]