summaryrefslogtreecommitdiff
path: root/python/vyos/configdict.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-07-24 17:17:38 +0200
committerChristian Poessinger <christian@poessinger.com>2020-07-25 15:36:44 +0200
commit0d21de93ce02fb0ae6e2e3ceb13dfd5b8dbe755f (patch)
treef7cdbb88b0b5add6627ab16f4673a968c67f3d04 /python/vyos/configdict.py
parent3998e140d13d99fde0c814816f4cf7533a38a61a (diff)
downloadvyos-1x-0d21de93ce02fb0ae6e2e3ceb13dfd5b8dbe755f.tar.gz
vyos-1x-0d21de93ce02fb0ae6e2e3ceb13dfd5b8dbe755f.zip
vyos.configdict: T2653: use dict_merge() over update()
With dict.update() existing keys will get overwritten when blending in interface default values.
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r--python/vyos/configdict.py6
1 files changed, 3 insertions, 3 deletions
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)