fix file_path (#45)
Reviewed-on: #45 Reviewed-by: Gode, Sebastian <sebastian.gode@t-systems.com> Co-authored-by: tischrei <tino.schreiber@t-systems.com> Co-committed-by: tischrei <tino.schreiber@t-systems.com>
This commit is contained in:
@ -14,7 +14,8 @@
|
||||
from pathlib import Path
|
||||
import json
|
||||
|
||||
analytics_path = Path("otc_metadata/analytics/public")
|
||||
BASE_DIR = Path(__file__).resolve().parent
|
||||
analytics_path = BASE_DIR / "public"
|
||||
|
||||
cloud_environments = [
|
||||
'eu_de',
|
||||
@ -24,8 +25,8 @@ analytics_data = {k: [] for k in cloud_environments}
|
||||
|
||||
# Open and read the json data files
|
||||
for env in cloud_environments:
|
||||
file_path = analytics_path.joinpath(f"{env}.json")
|
||||
with open(file_path, 'r') as file:
|
||||
file_path = analytics_path / f"{env}.json"
|
||||
with file_path.open(encoding="utf-8") as file:
|
||||
analytics_data[env] = json.load(file)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user