From 5c52d7746437bfdb9af12de126d40e21528a9068 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sun, 2 Oct 2022 13:19:32 -0400 Subject: [PATCH] [68] fix for #1067 --- VERSION | 2 +- modules/meta.py | 13 ++++++++++--- modules/util.py | 5 +++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 35e42109..0c0a9d15 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.3-develop67 +1.17.3-develop68 diff --git a/modules/meta.py b/modules/meta.py index 52f5a73e..6318e5ee 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -80,20 +80,27 @@ class DataFile: if "/" in data: if data.endswith(".yml"): return data[data.rfind("/") + 1:-4] + elif data.endswith(".yaml"): + return data[data.rfind("/") + 1:-5] else: return data[data.rfind("/") + 1:] elif "\\" in data: if data.endswith(".yml"): return data[data.rfind("\\") + 1:-4] + elif data.endswith(".yaml"): + return data[data.rfind("/") + 1:-5] else: return data[data.rfind("\\") + 1:] else: return data def load_file(self, file_type, file_path, library_type=None, overlay=False, translation=False): - if translation and file_path.endswith(".yml"): - file_path = file_path[:-4] - if not translation and not file_path.endswith(".yml"): + if translation: + if file_path.endswith(".yml"): + file_path = file_path[:-4] + elif file_path.endswith(".yaml"): + file_path = file_path[:-5] + if not translation and not file_path.endswith((".yml", ".yaml")): file_path = f"{file_path}.yml" if file_type in ["URL", "Git", "Repo"]: if file_type == "Repo" and not self.config.custom_repo: diff --git a/modules/util.py b/modules/util.py index eebe13da..b894ad84 100644 --- a/modules/util.py +++ b/modules/util.py @@ -440,11 +440,12 @@ def load_files(files_to_load, method, schedule=None, lib_vars=None): elif not os.path.isdir(file["folder"]): logger.error(f"Config Error: Folder not found: {file['folder']}") else: - yml_files = glob_filter(os.path.join(file["folder"], f"*.yml")) + yml_files = glob_filter(os.path.join(file["folder"], "*.yml")) + yml_files.extend(glob_filter(os.path.join(file["folder"], "*.yaml"))) if yml_files: current.extend([("File", yml, temp_vars, asset_directory) for yml in yml_files]) else: - logger.error(f"Config Error: No YAML (.yml) files found in {file['folder']}") + logger.error(f"Config Error: No YAML (.yml|.yaml) files found in {file['folder']}") if schedule and "schedule" in file and file["schedule"]: current_time, run_hour, ignore_schedules = schedule