From 0d21de93ce02fb0ae6e2e3ceb13dfd5b8dbe755f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 24 Jul 2020 17:17:38 +0200 Subject: vyos.configdict: T2653: use dict_merge() over update() With dict.update() existing keys will get overwritten when blending in interface default values. --- python/vyos/configdict.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/vyos/configdict.py') diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 7f05a15ed..f26b47e41 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -230,11 +230,11 @@ def get_interface_dict(config, base, ifname): # XML definitions which hold the defaults default_vif_values = defaults(base + ['vif']) for vif, vif_config in dict.get('vif', {}).items(): - vif_config.update(default_vif_values) + vif_config = dict_merge(default_vif_values, vif_config) for vif_s, vif_s_config in dict.get('vif_s', {}).items(): - vif_s_config.update(default_vif_values) + vif_s_config = dict_merge(default_vif_values, vif_s_config) for vif_c, vif_c_config in vif_s_config.get('vif_c', {}).items(): - vif_c_config.update(default_vif_values) + vif_c_config = dict_merge(default_vif_values, vif_c_config) # Check vif, vif-s/vif-c VLAN interfaces for removal dict = get_removed_vlans(config, dict) -- cgit v1.2.3