wireguard: Stop using some libnm deprecated API

- This is improved reliability of adding a new client.

Tests:

- Auto adding and removing a client works. Console messages do not warn about
deprecated commit_changes() API anymore.

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:50 -05:00
1 parent 50b77c5d73
commit 63ca0eadff
1 file changed
+2 -2
+2 -2
View File
@@ -355,7 +355,7 @@ def add_client(public_key):
peer.set_persistent_keepalive(25) # To keep NAT 'connections' alive peer.set_persistent_keepalive(25) # To keep NAT 'connections' alive
peer.append_allowed_ip(_get_next_available_ip_address(settings), False) peer.append_allowed_ip(_get_next_available_ip_address(settings), False)
settings.append_peer(peer) settings.append_peer(peer)
connection.commit_changes(True) connection.commit_changes_async(True)
network.reactivate_connection(connection.get_uuid()) network.reactivate_connection(connection.get_uuid())
# Wait upto 10 seconds for client to appear # Wait upto 10 seconds for client to appear
@@ -386,7 +386,7 @@ def remove_client(public_key):
raise KeyError('Client not found') raise KeyError('Client not found')
settings.remove_peer(peer_index) settings.remove_peer(peer_index)
connection.commit_changes(True) connection.commit_changes_async(True)
network.reactivate_connection(connection.get_uuid()) network.reactivate_connection(connection.get_uuid())
# Wait upto 10 seconds for client to disappear # Wait upto 10 seconds for client to disappear