summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-18 19:10:33 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-18 19:11:03 +0100
commit61e4d75abb1129f63df5a47b9c9bf0553850d893 (patch)
tree872b44127dea4fbe4aff754c7f584eb449c5e940 /python
parenteb6247e4b464c36fa7441627b221d0db39429251 (diff)
downloadvyos-1x-61e4d75abb1129f63df5a47b9c9bf0553850d893.tar.gz
vyos-1x-61e4d75abb1129f63df5a47b9c9bf0553850d893.zip
wwan: T3620: place interface in A/D state when removed
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/wwan.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/wwan.py b/python/vyos/ifconfig/wwan.py
index f18959a60..295f8bc2e 100644
--- a/python/vyos/ifconfig/wwan.py
+++ b/python/vyos/ifconfig/wwan.py
@@ -26,3 +26,19 @@ class WWANIf(Interface):
'eternal': 'wwan[0-9]+$',
},
}
+
+ def remove(self):
+ """
+ Remove interface from operating system. Removing the interface
+ deconfigures all assigned IP addresses.
+ Example:
+ >>> from vyos.ifconfig import WWANIf
+ >>> i = WWANIf('wwan0')
+ >>> i.remove()
+ """
+
+ if self.exists(self.ifname):
+ # interface is always A/D down. It needs to be enabled explicitly
+ self.set_admin_state('down')
+
+ super().remove()