From df5ecceefb1850166641e0af40f1fb74bb62397d Mon Sep 17 00:00:00 2001 From: Matteo Voges Date: Tue, 26 Sep 2023 13:45:34 +0200 Subject: [PATCH] fix: rename omegaconf --- kapitan/inventory/{omegaconf.py => omegaconf_inv.py} | 5 +++++ kapitan/resources.py | 2 +- tests/test_omegaconf.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) rename kapitan/inventory/{omegaconf.py => omegaconf_inv.py} (98%) diff --git a/kapitan/inventory/omegaconf.py b/kapitan/inventory/omegaconf_inv.py similarity index 98% rename from kapitan/inventory/omegaconf.py rename to kapitan/inventory/omegaconf_inv.py index ddec9032c..625afb494 100644 --- a/kapitan/inventory/omegaconf.py +++ b/kapitan/inventory/omegaconf_inv.py @@ -380,4 +380,9 @@ def load_config(self, path: str): return [], {} classes = OmegaConf.create(config.get("classes", [])) parameters = OmegaConf.create(config.get("parameters", {})) + + # add metadata to nodes + filename = os.path.splitext(os.path.split(path)[1])[0] + parameters._set_flag(["filename", "path"], [filename, path], recursive=True) + return classes, parameters diff --git a/kapitan/resources.py b/kapitan/resources.py index 0b8e6536e..d52de2339 100644 --- a/kapitan/resources.py +++ b/kapitan/resources.py @@ -22,7 +22,7 @@ import kapitan.cached as cached from kapitan import __file__ as kapitan_install_path from kapitan.errors import CompileError, InventoryError, KapitanError -from kapitan.inventory.omegaconf import OmegaConfBackend +from kapitan.inventory.omegaconf_inv import OmegaConfBackend from kapitan.inventory.reclass import ReclassBackend from kapitan.utils import ( PrettyDumper, diff --git a/tests/test_omegaconf.py b/tests/test_omegaconf.py index cebb6c0a7..7e30c3fb9 100644 --- a/tests/test_omegaconf.py +++ b/tests/test_omegaconf.py @@ -8,7 +8,7 @@ import yaml -from kapitan.inventory.omegaconf import OmegaConfBackend +from kapitan.inventory.omegaconf_inv import OmegaConfBackend class OmegaConfMigrationTest(unittest.TestCase):