#!/usr/bin/env python
################################################################################
-# Copyright 2021 highstreet technologies GmbH
+# Copyright 2023 highstreet technologies GmbH
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
import json
import requests
import subprocess
+import pathlib
+from jproperties import Properties
+
+def get_environment_variable(name):
+ configs = Properties()
+ path = pathlib.Path( os.path.dirname(os.path.abspath(__file__)) )
+ env_file = str(path.absolute()) + '/.env'
+ with open(env_file, "rb") as read_prop:
+ configs.load(read_prop)
+ return configs.get(name).data
dockerFilter = subprocess.check_output("docker ps --format '{{.Names}}'", shell=True)
containers = dockerFilter.splitlines()
mapping = dict({"ntsim-ng-o-ru": "O-RU", "ntsim-ng-o-du": "O-DU"})
# base = 'https://sdnc-web:8453'
-base = 'https://localhost:8453'
+base = get_environment_variable('SDN_CONTROLLER_PROTOCOL') + '://' + get_environment_variable('SDNC_OAM_HOST')
username = 'admin'
password = 'Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U'