feature: created cases for non-YAML parsing, tho not yet implemented

This commit is contained in:
2026-01-05 09:09:02 -05:00
parent 310fd28495
commit 8193cb6de6

View File

@@ -23,7 +23,7 @@ class Config:
filepath = Path(parent_dir) / filepath
filename: str = filepath.stem
self.parse_method = "yml"
self.parse_method = "YML"
if "." in filename:
filename_arr = filename.split(".")
basename: str = filename_arr[0]
@@ -45,7 +45,13 @@ class Config:
self.file = open(str(self.filepath), self.mode)
model = self.file.read()
self.model = yams.load(model)
if self.parse_method == "INI":
raise NotImplementedError
elif self.parse_method == "TOML":
raise NotImplementedError
else:
self.model = yams.load(model)
if self.scope == AnsibleScopes.GROUPVARS.name or self.scope == AnsibleScopes.HOSTVARS.name:
api_key: str = model["vps_service"]["api_key"]