network: Fix activating connections that don't have real devices

When a WireGuard connection is activated, it create the wireguard interface.
Looking for matching devices before activating a connection will then fail. Use
get_all_devices() API to get the list of all devices that are real and those
that will be created due to connection activation.

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 2020-01-18 13:52:26 -05:00
1 parent 25317700c2
commit 68e5684d10
1 file changed
+1 -1
+1 -1
View File
@@ -486,7 +486,7 @@ def activate_connection(connection_uuid):
connection = get_connection(connection_uuid)
interface = connection.get_interface_name()
client = get_nm_client()
for device in client.get_devices():
for device in client.get_all_devices():
if device.get_iface() == interface:
client.activate_connection_async(connection, device, '/', None,
_callback, None)