summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-macsec.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/interfaces-macsec.py')
-rwxr-xr-xsrc/conf_mode/interfaces-macsec.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-macsec.py b/src/conf_mode/interfaces-macsec.py
index 613648adb..706b8edb0 100755
--- a/src/conf_mode/interfaces-macsec.py
+++ b/src/conf_mode/interfaces-macsec.py
@@ -16,6 +16,7 @@
import os
+from netifaces import interfaces
from sys import exit
from vyos.config import Config
@@ -114,7 +115,9 @@ def apply(macsec):
call('systemctl stop wpa_supplicant-macsec@{source_interface}'
.format(**macsec))
- MACsecIf(macsec['ifname']).remove()
+ if macsec['ifname'] in interfaces():
+ tmp = MACsecIf(macsec['ifname'])
+ tmp.remove()
# delete configuration on interface removal
if os.path.isfile(wpa_suppl_conf.format(**macsec)):