X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=solution%2Fnetwork%2Fconfig.py;fp=solution%2Fintegration%2Fnetwork%2Fconfig.py;h=57aab93634e891b977dcc2117ecd551a9f31fc3f;hb=990de7205645f827a36429006f7e5529b5fb6866;hp=30c4a39f6029b1766b42b6714131cef31cd25063;hpb=a3be9ade3bec5ca8cd5b41032704872f87d8c065;p=oam.git diff --git a/solution/integration/network/config.py b/solution/network/config.py similarity index 83% rename from solution/integration/network/config.py rename to solution/network/config.py index 30c4a39..57aab93 100644 --- a/solution/integration/network/config.py +++ b/solution/network/config.py @@ -1,6 +1,6 @@ #!/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. @@ -21,13 +21,23 @@ import sys 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'