From e507d0867326782bf93ed703ca877ca31dead2d6 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Wed, 24 Jun 2020 11:26:48 +0100 Subject: dictconfig: T2637: identify sub-interfaces (vif) to delete --- python/vyos/configdict.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'python/vyos/configdict.py') diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 973fbdd8b..ce086872e 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -224,6 +224,14 @@ def intf_to_dict(conf, default): intf = deepcopy(default) intf['intf'] = ifname_from_config(conf) + current_vif_list = conf.list_nodes(['vif']) + previous_vif_list = conf.list_effective_nodes(['vif']) + + # set the vif to be deleted + for vif in previous_vif_list: + if vif not in current_vif_list: + intf['vif_remove'].append(vif) + # retrieve interface description if conf.exists(['description']): intf['description'] = conf.return_value(['description']) -- cgit v1.2.3