summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-08 22:27:37 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-08 22:27:37 +0200
commit9123a03824f083035f130477bb7b030e559cc9ec (patch)
tree116507715927f2e4fdf02ae73e372a5beb5145e9 /src/conf_mode
parent6474b89e2dca1abff79ad385992d2302ce033e93 (diff)
downloadvyos-1x-9123a03824f083035f130477bb7b030e559cc9ec.tar.gz
vyos-1x-9123a03824f083035f130477bb7b030e559cc9ec.zip
wireguard: T2244: re-use interface removal code from WireGuardIf class
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-wireguard.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/conf_mode/interfaces-wireguard.py b/src/conf_mode/interfaces-wireguard.py
index 8a44fe5e7..e9d9ad459 100755
--- a/src/conf_mode/interfaces-wireguard.py
+++ b/src/conf_mode/interfaces-wireguard.py
@@ -222,20 +222,6 @@ def verify(wg):
def apply(wg):
- # no wg configs left, remove all interface from system
- # maybe move it into ifconfig.py
- if wg['deleted']:
- net_devs = os.listdir('/sys/class/net/')
- for dev in net_devs:
- if os.path.isdir('/sys/class/net/' + dev):
- buf = open('/sys/class/net/' + dev + '/uevent', 'r').read()
- if re.search("DEVTYPE=wireguard", buf, re.I | re.M):
- wg_intf = re.sub("INTERFACE=", "", re.search(
- "INTERFACE=.*", buf, re.I | re.M).group(0))
- # XXX: we are ignoring any errors here
- run(f'ip link del dev {wg_intf} >/dev/null')
- return None
-
# init wg class
w = WireGuardIf(wg['intf'])