ENV OSMPOL_MESSAGE_PORT 9092
ENV OSMPOL_DATABASE_DRIVER mongo
-ENV OSMPOL_DATABASE_HOST mongo
-ENV OSMPOL_DATABASE_PORT 27017
+ENV OSMPOL_DATABASE_URI mongodb://mongo:27017
ENV OSMPOL_SQL_DATABASE_URI sqlite:///policy_module.db
def __init__(self):
cfg = Config.instance()
self.common_db = dbmongo.DbMongo()
- self.common_db.db_connect({'host': cfg.OSMPOL_DATABASE_HOST,
- 'port': int(cfg.OSMPOL_DATABASE_PORT),
+ self.common_db.db_connect({'uri': cfg.OSMPOL_DATABASE_URI,
'name': 'osm'})
def get_vnfr(self, nsr_id: str, member_index: int):
self.kafka_server = '{}:{}'.format(cfg.OSMPOL_MESSAGE_HOST,
cfg.OSMPOL_MESSAGE_PORT)
self.common_db = dbmongo.DbMongo()
- self.common_db.db_connect({'host': cfg.OSMPOL_DATABASE_HOST,
- 'port': int(cfg.OSMPOL_DATABASE_PORT),
+ self.common_db.db_connect({'uri': cfg.OSMPOL_DATABASE_URI,
'name': 'osm'})
if not loop:
loop = asyncio.get_event_loop()
CfgParam('OSMPOL_MESSAGE_HOST', "localhost", six.text_type),
CfgParam('OSMPOL_MESSAGE_PORT', 9092, int),
CfgParam('OSMPOL_DATABASE_DRIVER', "mongo", six.text_type),
- CfgParam('OSMPOL_DATABASE_HOST', "mongo", six.text_type),
- CfgParam('OSMPOL_DATABASE_PORT', 27017, int),
+ CfgParam('OSMPOL_DATABASE_URI', "mongodb://mongo:27017", six.text_type),
CfgParam('OSMPOL_SQL_DATABASE_URI', "sqlite:///policy_module.db", six.text_type),
CfgParam('OSMPOL_LOG_LEVEL', "INFO", six.text_type),
CfgParam('OSMPOL_KAFKA_LOG_LEVEL', "WARN", six.text_type),