From 5c2245a8ae2966a2160f2d88ea84c2d1b1d7af43 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Tue, 17 Dec 2024 15:57:21 +0800 Subject: [PATCH] [deploy-mg][mx] Fix generate golden config db failed in mx with OS version doesn't support dhcp_server (#16086) What is the motivation for this PR? Golden config db var has been changed from json like string to dict by this RP #15922 But for mx with OS version doesn't support dhcp_server, it would still generate empty json like string, which would cause failure How did you do it? Change empty golden config generated for mx doesn't support dhcp_server How did you verify/test it? Deploy-mg --- ansible/library/generate_golden_config_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/library/generate_golden_config_db.py b/ansible/library/generate_golden_config_db.py index 7bf0dd72203..a40efa499ac 100644 --- a/ansible/library/generate_golden_config_db.py +++ b/ansible/library/generate_golden_config_db.py @@ -66,7 +66,7 @@ def generate_mx_golden_config_db(self): # Generate FEATURE table from init_cfg.ini ori_config_db = json.loads(out) if "FEATURE" not in ori_config_db or "dhcp_server" not in ori_config_db["FEATURE"]: - return "{}" + return {} ori_config_db["FEATURE"]["dhcp_server"]["state"] = "enabled" gold_config_db = {