diff options
author | Christian Breunig <christian@breunig.cc> | 2024-01-21 20:49:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-21 20:49:02 +0100 |
commit | d2a09a547d0038e9f34737b28b84310a42ac426f (patch) | |
tree | 50451707b7fc206a27534d6f7bd49326fa28ce02 /python/vyos/ifconfig/ethernet.py | |
parent | 31c03bef52a01591b16a6bc71286dbd13e2bd6f4 (diff) | |
parent | 31ba9f00628da7da4339b4cdc2d208e06d686092 (diff) | |
download | vyos-1x-d2a09a547d0038e9f34737b28b84310a42ac426f.tar.gz vyos-1x-d2a09a547d0038e9f34737b28b84310a42ac426f.zip |
Merge pull request #2868 from vyos/mergify/bp/equuleus/pr-2850
ethernet: T4638: deleting parent interface does not delete underlying VIFs (backport #2850)
Diffstat (limited to 'python/vyos/ifconfig/ethernet.py')
-rw-r--r-- | python/vyos/ifconfig/ethernet.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index c9fa6ea8b..3fe54d7bf 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -19,6 +19,7 @@ import re from glob import glob from vyos.ethtool import Ethtool +from vyos.ifconfig import Section from vyos.ifconfig.interface import Interface from vyos.util import run from vyos.util import dict_search @@ -91,6 +92,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): |