summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2018-11-05 12:09:44 -0800
committerhagbard <vyosdev@derith.de>2018-11-05 12:10:52 -0800
commit19a53701d7c0bd2bfc9d773db88ef3f8634d15f3 (patch)
tree1b6ada55a163e970fd0a91076cbca2411bd3e51a
parent67c9d917d4e63e65746e277d7e516a4d7f0826c0 (diff)
downloadvyos-1x-19a53701d7c0bd2bfc9d773db88ef3f8634d15f3.tar.gz
vyos-1x-19a53701d7c0bd2bfc9d773db88ef3f8634d15f3.zip
T966: Traceback when deleting wireguard interface
-rwxr-xr-xsrc/conf_mode/wireguard.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/conf_mode/wireguard.py b/src/conf_mode/wireguard.py
index 3c8ade1db..5d390f39f 100755
--- a/src/conf_mode/wireguard.py
+++ b/src/conf_mode/wireguard.py
@@ -221,11 +221,12 @@ def apply(c):
configure_interface(c, intf)
### ifalias for snmp from description
- descr_eff = c_eff.return_effective_value(intf + ' description')
- cnf_descr = c['interfaces'][intf]['descr']
- if descr_eff != cnf_descr:
- with open('/sys/class/net/' + str(intf) + '/ifalias', 'w') as fh:
- fh.write(str(cnf_descr))
+ if c['interfaces'][intf]['status'] != 'delete':
+ descr_eff = c_eff.return_effective_value(intf + ' description')
+ cnf_descr = c['interfaces'][intf]['descr']
+ if descr_eff != cnf_descr:
+ with open('/sys/class/net/' + str(intf) + '/ifalias', 'w') as fh:
+ fh.write(str(cnf_descr))
def configure_interface(c, intf):
for p in c['interfaces'][intf]['peer']: