wireguard: Throw exception when client can't be added

- Sometimes a newly added client can't be found even after waiting 10 seconds.
In these cases the changes are mostly lost. Raise an exception instead showing
that the client has been added.

Tests:

- When client adding fails, exception is raised instead of successfully showing
the result page.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2026-11-27 07:20:54 -05:00
1 parent 63ca0eadff
commit 0bb52bf8ae
1 file changed
+2 -1
+2 -1
View File
@@ -373,7 +373,8 @@ def add_client(public_key):
time.sleep(1)
else:
logging.warning('Could not add client %s', public_key)
logging.warning('Error adding client %s', public_key)
raise RuntimeError('Error adding client')
def remove_client(public_key):