From b1b021ffd6619c1cce2f3132ebbebb32b30035fc Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 15 Oct 2025 17:45:28 -0700 Subject: [PATCH] fifloader: co-operatively merge settings from ProductDefaults This allows us to set defaults for settings in ProductDefaults and have the settings dicts in individual products merge with them, not overwrite them. Signed-off-by: Adam Williamson --- fifloader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fifloader.py b/fifloader.py index 4cc54a96..0f559e21 100755 --- a/fifloader.py +++ b/fifloader.py @@ -183,6 +183,10 @@ def merge_inputs(inputs, validate=False, clean=False): schema_validate(data, fif=True, state="predefault") for (pname, product) in data["Products"].items(): temp = dict(data.get("ProductDefaults", {})) + if "settings" in product and "settings" in temp: + # merge settings co-operatively + prodsetts = product.pop("settings") + temp["settings"].update(prodsetts) temp.update(product) data["Products"][pname] = temp # validate against incomplete schema