summaryrefslogtreecommitdiff
path: root/clients/cli
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-10-10 15:37:45 +0200
committerLubomir Rintel <lkundrak@v3.sk>2019-10-18 17:38:57 +0200
commit8766d05ea946cbaeca69322607a8e4c2d969c28b (patch)
tree559a34f9d33a48dd59b3d144589adb53c74516c9 /clients/cli
parent2ca172ebeacfbe9ece1fc925b1983aaae6e6d78e (diff)
downloadNetworkManager-8766d05ea946cbaeca69322607a8e4c2d969c28b.tar.gz
cli/devices: on connecting a device, don't uselessly look it up from the ac
For quite some time we already pass the AddAndActivateInfo for device connect too, and that one remembers the device.
Diffstat (limited to 'clients/cli')
-rw-r--r--clients/cli/devices.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index 2d265c8e46..e89c0c3747 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -1940,9 +1940,8 @@ connect_device_cb (GObject *client, GAsyncResult *result, gpointer user_data)
nm_auto_free_add_and_activate_info AddAndActivateInfo *info = user_data;
NmCli *nmc = info->nmc;
gs_unref_object NMActiveConnection *active = NULL;
+ NMDevice *device = info->device;
GError *error = NULL;
- const GPtrArray *devices;
- NMDevice *device;
active = nm_client_activate_connection_finish (NM_CLIENT (client), result, &error);
@@ -1964,16 +1963,6 @@ connect_device_cb (GObject *client, GAsyncResult *result, gpointer user_data)
nm_assert (NM_IS_ACTIVE_CONNECTION (active));
- devices = nm_active_connection_get_devices (active);
- if (devices->len == 0) {
- g_string_printf (nmc->return_text, _("Error: Device activation failed: device was disconnected"));
- nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
- quit ();
- return;
- }
-
- device = g_ptr_array_index (devices, 0);
-
if (nmc->nowait_flag) {
quit ();
return;