summaryrefslogtreecommitdiff
path: root/python
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:36:19 +0100
commitf8b36a74e6530c0f94ce7df6a980a50ead1f409f (patch)
tree9bd3e60d426f53934831cd563d1f91108fe92f17 /python
parent8dcb089916795aa83768fe429c4e280b95079ca9 (diff)
downloadvyos-1x-f8b36a74e6530c0f94ce7df6a980a50ead1f409f.tar.gz
vyos-1x-f8b36a74e6530c0f94ce7df6a980a50ead1f409f.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. (cherry picked from commit b3be36586c85005538d5cc994c7c9694b9907d81)
Diffstat (limited to 'python')
-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 3668331bb..8e5781b81 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