summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces_openvpn.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-04-04 15:09:55 +0200
committerGitHub <noreply@github.com>2024-04-04 15:09:55 +0200
commit7f077a0dfc410d974f891e34f0726809d4b1a5b1 (patch)
tree637bdf33a0e87ae735ecd3f19ab120863b3f30be /src/conf_mode/interfaces_openvpn.py
parentd729069c58c0a670e1f57d6d12c57a41e330742b (diff)
parentca84e6845e6cfeb5f4f5798594b390afb735901f (diff)
downloadvyos-1x-7f077a0dfc410d974f891e34f0726809d4b1a5b1.tar.gz
vyos-1x-7f077a0dfc410d974f891e34f0726809d4b1a5b1.zip
Merge pull request #3241 from c-po/spring-cleaning-sagitta
T6199: spring cleaning - drop unused Python imports (backport #3240)
Diffstat (limited to 'src/conf_mode/interfaces_openvpn.py')
-rwxr-xr-xsrc/conf_mode/interfaces_openvpn.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces_openvpn.py b/src/conf_mode/interfaces_openvpn.py
index 45569dd21..505ec55c6 100755
--- a/src/conf_mode/interfaces_openvpn.py
+++ b/src/conf_mode/interfaces_openvpn.py
@@ -16,7 +16,6 @@
import os
import re
-import tempfile
from cryptography.hazmat.primitives.asymmetric import ec
from glob import glob
@@ -26,7 +25,6 @@ from ipaddress import IPv4Network
from ipaddress import IPv6Address
from ipaddress import IPv6Network
from ipaddress import summarize_address_range
-from netifaces import interfaces
from secrets import SystemRandom
from shutil import rmtree
@@ -63,6 +61,7 @@ from vyos.utils.process import call
from vyos.utils.permission import chown
from vyos.utils.process import cmd
from vyos.utils.network import is_addr_assigned
+from vyos.utils.network import interface_exists
from vyos import ConfigError
from vyos import airbag
@@ -683,7 +682,7 @@ def apply(openvpn):
if os.path.isfile(cleanup_file):
os.unlink(cleanup_file)
- if interface in interfaces():
+ if interface_exists(interface):
VTunIf(interface).remove()
# dynamically load/unload DCO Kernel extension if requested