fix file_path
This commit is contained in:
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user