summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-18 17:51:04 +0100
committerGitHub <noreply@github.com>2024-01-18 17:51:04 +0100
commiteb4cac98cb3790eb888d4ea7626781b9afbea8f4 (patch)
tree25cf384915f705080e51a43edde420348c76d216 /python
parent56a02a94a8b1fbc69fd3bc437ed49a354a340140 (diff)
parent7ba47f027f3a9441125c13a927eb23cee2de041b (diff)
downloadvyos-1x-eb4cac98cb3790eb888d4ea7626781b9afbea8f4.tar.gz
vyos-1x-eb4cac98cb3790eb888d4ea7626781b9afbea8f4.zip
Merge pull request #2850 from c-po/ethernet-4638
ethernet: T4638: deleting parent interface does not delete underlying VIFs
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/ethernet.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py
index aaf903acd..dde87149d 100644
--- a/python/vyos/ifconfig/ethernet.py
+++ b/python/vyos/ifconfig/ethernet.py
@@ -19,6 +19,7 @@ from glob import glob
from vyos.base import Warning
from vyos.ethtool import Ethtool
+from vyos.ifconfig import Section
from vyos.ifconfig.interface import Interface
from vyos.utils.dict import dict_search
from vyos.utils.file import read_file
@@ -128,6 +129,10 @@ class EthernetIf(Interface):
# will remain visible for the operating system.
self.set_admin_state('down')
+ # Remove all VLAN subinterfaces - filter with the VLAN dot
+ for vlan in [x for x in Section.interfaces(self.iftype) if x.startswith(f'{self.ifname}.')]:
+ Interface(vlan).remove()
+
super().remove()
def set_flow_control(self, enable):