Remove PyYAML usages and dependency (#13889)

This commit is contained in:
Nicolas Mowen
2024-09-22 13:08:36 -06:00
committed by GitHub
parent e8763b3697
commit 6bafb68d77
5 changed files with 12 additions and 9 deletions

View File

@@ -3,7 +3,9 @@
import json
import os
import yaml
from ruamel.yaml import YAML
yaml = YAML()
config_file = os.environ.get("CONFIG_FILE", "/config/config.yml")
@@ -17,7 +19,7 @@ try:
raw_config = f.read()
if config_file.endswith((".yaml", ".yml")):
config: dict[str, any] = yaml.safe_load(raw_config)
config: dict[str, any] = yaml.load(raw_config)
elif config_file.endswith(".json"):
config: dict[str, any] = json.loads(raw_config)
except FileNotFoundError: