aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kuzmicki <krzysztof.kuzmicki@nokia.com>2021-04-12 23:21:59 +0200
committerKrzysztof Kuzmicki <krzysztof.kuzmicki@nokia.com>2021-04-12 23:21:59 +0200
commitb57c3fbd4dfe4cbaf214f5eda4f75dd13ce93b4b (patch)
treed512bfe61b719faec2913bd4f3ac0a2a2f0d2034
parent34d40a50b8dc39e72b3677f607fad1df29c392fd (diff)
Add possibility to have two mongo dbs and two independent ves-clients during one test run in k8s
Fix mongo db init script Issue-ID: INT-1815 Signed-off-by: Krzysztof Kuzmicki <krzysztof.kuzmicki@nokia.com> Change-Id: Ic177a7993eafb524cfb755c73bff2ab6543eb668
-rw-r--r--config/mongo_db_schema_creation.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/config/mongo_db_schema_creation.py b/config/mongo_db_schema_creation.py
index 3e79805..dda1e2a 100644
--- a/config/mongo_db_schema_creation.py
+++ b/config/mongo_db_schema_creation.py
@@ -18,6 +18,7 @@
from pymongo import MongoClient
import argparse
+import os
parser = argparse.ArgumentParser(description='Script creates configuration in pnf simulator mongodb if it doesn\'t exists.')
args = parser.parse_args()
@@ -37,7 +38,7 @@ def init_mongo_db(client, col_list):
if __name__ == "__main__":
- client = MongoClient(host='mongo',
+ client = MongoClient(host=os.getenv('MONGO_HOSTNAME', 'mongo'),
port=27017,
username='root',
password=MONGO_DB_PASSWORD,