From d3bb77e6bb031270e37ceb83354a1cad9b000317 Mon Sep 17 00:00:00 2001 From: hagbard Date: Mon, 20 Aug 2018 16:38:25 +0000 Subject: bugfix: if config and effective value are equal, there is no change required, deleting it from the dict will result in a keyerror if not aset at all --- src/conf_mode/wireguard.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/wireguard.py b/src/conf_mode/wireguard.py index e1c076e2a..a4f876397 100755 --- a/src/conf_mode/wireguard.py +++ b/src/conf_mode/wireguard.py @@ -209,13 +209,9 @@ def apply(c): if val_eff and not val: c['interfaces'][intf]['peer'][p]['persistent-keepalive'] = 0 - ### set ne keepalive value + ### set new keepalive value if not val_eff and val: c['interfaces'][intf]['peer'][p]['persistent-keepalive'] = val - - ## config == effective config, no change - if val_eff == val: - del c['interfaces'][intf]['peer'][p]['persistent-keepalive'] ## wg command call configure_interface(c,intf) -- cgit v1.2.3