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 2020-01-15 14:49:52 -08:00 committed by James Valleroy
parent 25317700c2
commit 68e5684d10
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

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)