summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-macsec.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-05-21 16:08:26 +0200
committerChristian Poessinger <christian@poessinger.com>2020-05-21 16:08:26 +0200
commit5df7e8f35234497c03d504ea838dbd7044c49bb3 (patch)
tree8f73508e231f9de949eeec6a4b7efa1a25759bda /src/conf_mode/interfaces-macsec.py
parentd8d3c1cb5a5aed4ecee9ea1a17dafc09c98bdfaa (diff)
downloadvyos-1x-5df7e8f35234497c03d504ea838dbd7044c49bb3.tar.gz
vyos-1x-5df7e8f35234497c03d504ea838dbd7044c49bb3.zip
macsec: T2023: cleanup wpa_supplicant config file name
Diffstat (limited to 'src/conf_mode/interfaces-macsec.py')
-rwxr-xr-xsrc/conf_mode/interfaces-macsec.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces-macsec.py b/src/conf_mode/interfaces-macsec.py
index efac92169..ed88e877d 100755
--- a/src/conf_mode/interfaces-macsec.py
+++ b/src/conf_mode/interfaces-macsec.py
@@ -155,14 +155,16 @@ def verify(macsec):
def generate(macsec):
# XXX: wpa_supplicant works on the source interface not the resulting
# MACsec interface
- conf = f'/run/wpa_supplicant/wpa_supplicant-{macsec["source_interface"]}.conf'
+ wpa_suppl_conf = '/run/wpa_supplicant/{source_interface}.conf'
+ conf = wpa_suppl_conf.format(**macsec)
+
render(conf, 'macsec/wpa_supplicant.conf.tmpl', macsec, permission=0o640)
return None
def apply(macsec):
# Remove macsec interface
if macsec['deleted']:
- call(f'systemctl stop wpa_supplicant-@{macsec["intf"]}.service')
+ call('systemctl stop wpa_supplicant-macsec@{intf}.service'.format(**macsec))
MACsecIf(macsec['intf']).remove()
else:
@@ -199,7 +201,7 @@ def apply(macsec):
if not macsec['disable']:
i.set_admin_state('up')
- call(f'systemctl restart wpa_supplicant-macsec@{macsec["source_interface"]}.service')
+ call('systemctl restart wpa_supplicant-macsec@{source_interface}.service'.format(**macsec))
return None