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(-) 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 From 2a4b380ecdf5c51a41dfee64652cd77789a8204c Mon Sep 17 00:00:00 2001 From: hagbard Date: Mon, 20 Aug 2018 16:39:53 +0000 Subject: regex fixed, at least 1 digit is required --- interface-definitions/wireguard.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface-definitions/wireguard.xml b/interface-definitions/wireguard.xml index eec7a404b..1437e9f0c 100644 --- a/interface-definitions/wireguard.xml +++ b/interface-definitions/wireguard.xml @@ -72,7 +72,7 @@ how often send keep alives in seconds - ^(1|[1-9][0-9]{0,5})$ + ^(1|[1-9][0-9]{1,5})$ keepliave timer has to be between 1 and 99999 seconds -- cgit v1.2.3