From e1abd4f61f31d9ce7c54fe790a30d973aae53ab2 Mon Sep 17 00:00:00 2001 From: hagbard Date: Mon, 5 Nov 2018 12:09:44 -0800 Subject: T966: Traceback when deleting wireguard interface --- src/conf_mode/wireguard.py | 11 ++++++----- 1 file 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']: -- cgit v1.2.3