From 0c6275531a2ce09279754ec4c0e03c3616ff0fa1 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Jan 08 2021 12:34:36 +0000 Subject: Use the right raw_config_wrapper configuration file for compose respin. If we are doing respin of raw_config compose with raw_config_wrapper defined, the current code wrongly loads just created empty `main_cfg_path` instead the `pungi.conf` which stores the raw_config_wrapper. Signed-off-by: Jan Kaluza --- diff --git a/server/odcs/server/pungi.py b/server/odcs/server/pungi.py index eed1289..e3a3cb8 100644 --- a/server/odcs/server/pungi.py +++ b/server/odcs/server/pungi.py @@ -159,7 +159,7 @@ class RawPungiConfig(BasePungiConfig): # Load the raw_config_wrapper and update pungi_config_dump. raw_config_wrapper = PyConfigParser() - raw_config_wrapper.load_from_file(main_cfg_path) + raw_config_wrapper.load_from_file(os.path.join(topdir, "pungi.conf")) pungi_config_dump.update(raw_config_wrapper) # Create the pungi.json diff --git a/server/tests/test_pungi.py b/server/tests/test_pungi.py index 90c5836..c6d1641 100644 --- a/server/tests/test_pungi.py +++ b/server/tests/test_pungi.py @@ -923,6 +923,8 @@ class TestRawPungiConfig(ModelsBaseTest): pungi_conf = json.load(fd) for key in config.keys(): self.assertEqual(pungi_conf[key], config[key]) + # Test that raw_config_wrapper really updated the pungi config. + self.assertEqual(pungi_conf["koji_profile"], "odcs_stg") finally: shutil.rmtree(td)