fix file_path
All checks were successful
Run Tox Check / tox-py312 (pull_request) Successful in 16s
Run Tox Check / tox-pep8 (pull_request) Successful in 15s
Updates Opensearch filters / update-opensearch-filters (pull_request) Successful in 10s

This commit is contained in:
2025-08-13 13:14:15 +00:00
parent d6c1eecd79
commit 5adcea0c36

View File

@ -14,7 +14,8 @@
from pathlib import Path from pathlib import Path
import json import json
analytics_path = Path("otc_metadata/analytics/public") BASE_DIR = Path(__file__).resolve().parent
analytics_path = BASE_DIR / "public"
cloud_environments = [ cloud_environments = [
'eu_de', 'eu_de',
@ -24,8 +25,8 @@ analytics_data = {k: [] for k in cloud_environments}
# Open and read the json data files # Open and read the json data files
for env in cloud_environments: for env in cloud_environments:
file_path = analytics_path.joinpath(f"{env}.json") file_path = analytics_path / f"{env}.json"
with open(file_path, 'r') as file: with file_path.open(encoding="utf-8") as file:
analytics_data[env] = json.load(file) analytics_data[env] = json.load(file)