diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-24 18:30:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-24 18:30:37 +0200 |
commit | d4ed1b0602f1a96cd5b5104268c1a1155c042062 (patch) | |
tree | addf080125bc147c394f017ce7e0a90a2d15d242 /python/vyos/configdict.py | |
parent | 5644809bb4384de8e409042d803d1898124178e1 (diff) | |
parent | e507d0867326782bf93ed703ca877ca31dead2d6 (diff) | |
download | vyos-1x-d4ed1b0602f1a96cd5b5104268c1a1155c042062.tar.gz vyos-1x-d4ed1b0602f1a96cd5b5104268c1a1155c042062.zip |
Merge pull request #474 from thomas-mangin/T2637
dictconfig: T2637: identify sub-interfaces (vif) to delete
Diffstat (limited to 'python/vyos/configdict.py')
-rw-r--r-- | python/vyos/configdict.py | 8 |
1 files changed, 8 insertions, 0 deletions
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']) |