diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-08-25 21:07:24 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-08-25 21:14:15 +0200 |
commit | 906c218f8455a3062bc3fa6810925257452c3b80 (patch) | |
tree | cddee8c3bad22fd102fc1265775900dfe59555b1 /clients/cli/connections.c | |
parent | d7a9ec036e5f3338bf1fccfbc304f46c298963e3 (diff) | |
download | NetworkManager-bg/rh1367752.tar.gz |
cli: connections: fail the activation if the ac deactivatesbg/rh1367752
Since commit ac888de15103 ("cli/connections: fail the activation when
the active connection disappears") we rely only on the disappearing of
the active-connection to determine the failure of an activation.
libnm can collapse a 'added' and a 'removed' signal if they are
received closer enough and thus we may miss the removal of the active
connection. Restore the detection of failure based on
active-connection state.
Diffstat (limited to 'clients/cli/connections.c')
-rw-r--r-- | clients/cli/connections.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index ea7c8a79df..3e85ca5bd8 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -2178,6 +2178,10 @@ active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, Activ g_print (_("Connection successfully activated (D-Bus active path: %s)\n"), nm_object_get_path (NM_OBJECT (active))); activate_connection_info_finish (info); + } else if (state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) { + g_string_printf (nmc->return_text, _("Error: Connection activation failed.")); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + activate_connection_info_finish (info); } else if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING) { /* activating master connection does not automatically activate any slaves, so their * active connection state will not progress beyond ACTIVATING state. |