Do not complete MongoDBContext with out replset

When there are multiple mongodb peers but replset has not yet been set
on the relation, do not complete the MongoDBContext. This causes the
template to be rendered incorrectly and leads to the following error:

ERROR ceilometer ValueError: Port must be an integer between 0 and
65535:

Closes-Bug: #1750639
Change-Id: Ifb9424ac5e175d788fa21de0ee332c0a13e61a9f
This commit is contained in:
David Ames 2018-02-24 13:10:36 -08:00
parent 3438d424b0
commit 4eec1929c5
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ class MongoDBContext(OSContextGenerator):
mongo_servers.append('{}:{}'.format(host, port))
if mongo_servers:
if mongo_servers and replset:
return {
'db_mongo_servers': ','.join(mongo_servers),
'db_name': CEILOMETER_DB,