summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-05 20:34:52 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-05 20:34:52 +0100
commitb3be36586c85005538d5cc994c7c9694b9907d81 (patch)
treedf6e583ed13021ffecfbfccfbd9346537f4b6b36
parent999398c6ba191a03e0c879953579326eb3be96ab (diff)
downloadvyos-1x-b3be36586c85005538d5cc994c7c9694b9907d81.tar.gz
vyos-1x-b3be36586c85005538d5cc994c7c9694b9907d81.zip
vyos.configdict: T3972: bugfix QinQ vif-c removal triggered KeyError
Generic get_removed_vlans() function replaced the entire config dict when any QinQ vif-c subinterface was deleted.
-rw-r--r--python/vyos/configdict.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index afdd62a73..e8a87bc38 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -155,18 +155,15 @@ def get_removed_vlans(conf, dict):
D.set_level(conf.get_level())
# get_child_nodes() will return dict_keys(), mangle this into a list with PEP448
keys = D.get_child_nodes_diff(['vif'], expand_nodes=Diff.DELETE)['delete'].keys()
- if keys:
- dict.update({'vif_remove': [*keys]})
+ if keys: dict['vif_remove'] = [*keys]
# get_child_nodes() will return dict_keys(), mangle this into a list with PEP448
keys = D.get_child_nodes_diff(['vif-s'], expand_nodes=Diff.DELETE)['delete'].keys()
- if keys:
- dict.update({'vif_s_remove': [*keys]})
+ if keys: dict['vif_s_remove'] = [*keys]
for vif in dict.get('vif_s', {}).keys():
keys = D.get_child_nodes_diff(['vif-s', vif, 'vif-c'], expand_nodes=Diff.DELETE)['delete'].keys()
- if keys:
- dict.update({'vif_s': { vif : {'vif_c_remove': [*keys]}}})
+ if keys: dict['vif_s'][vif]['vif_c_remove'] = [*keys]
return dict