diff options
-rw-r--r-- | clients/cli/connections.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 02cab47c7e..4bc79a8cbf 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -2130,6 +2130,11 @@ nmc_activate_connection (NmCli *nmc, return FALSE; } g_clear_error (&local); + + /* Create -a secret agent for the connection */ + nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-connect", nm_object_get_path (NM_OBJECT (connection))); + if (nmc->secret_agent) + g_signal_connect (nmc->secret_agent, "request-secrets", G_CALLBACK (secrets_requested), nmc); } else if (ifname) { device = nm_client_get_device_by_iface (nmc->client, ifname); if (!device) { @@ -2153,11 +2158,6 @@ nmc_activate_connection (NmCli *nmc, g_hash_table_destroy (nmc->pwds_hash); nmc->pwds_hash = pwds_hash; - /* Create secret agent */ - nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-connect", nm_object_get_path (NM_OBJECT (connection))); - if (nmc->secret_agent) - g_signal_connect (nmc->secret_agent, "request-secrets", G_CALLBACK (secrets_requested), nmc); - info = g_malloc0 (sizeof (ActivateConnectionInfo)); info->nmc = nmc; info->device = device; |