diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-11-05 20:34:52 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-11-05 20:34:52 +0100 |
commit | b3be36586c85005538d5cc994c7c9694b9907d81 (patch) | |
tree | df6e583ed13021ffecfbfccfbd9346537f4b6b36 /python/vyos | |
parent | 999398c6ba191a03e0c879953579326eb3be96ab (diff) | |
download | vyos-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.
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/configdict.py | 9 |
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 |