diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-04-01 17:10:58 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-04-29 11:16:30 +0200 |
commit | a06487a6ae5aac42ce1849dc891fc20020168a11 (patch) | |
tree | e9e85e5dc4a58f49a6e763b821203eeb82b15926 | |
parent | f027b71f6597f5081c87b70e044a4d0c4202766d (diff) | |
download | NetworkManager-a06487a6ae5aac42ce1849dc891fc20020168a11.tar.gz |
cli: handle device failure when activating
We might receive the update of the device state to FAILED when the
active connection is still in ACTIVATING. Handle this case properly.
-rw-r--r-- | clients/cli/connections.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index ee9fe0850b..d01e38efba 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -1970,12 +1970,19 @@ device_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data) nm_object_get_path (NM_OBJECT (active))); quit (); } else if ( ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING - && state >= NM_DEVICE_STATE_IP_CONFIG) { + && state >= NM_DEVICE_STATE_IP_CONFIG + && state <= NM_DEVICE_STATE_ACTIVATED) { if (nmc->print_output == NMC_PRINT_PRETTY) nmc_terminal_erase_line (); g_print (_("Connection successfully activated (master waiting for slaves) (D-Bus active path: %s)\n"), nm_object_get_path (NM_OBJECT (active))); quit (); + } else if ( ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING + && state == NM_DEVICE_STATE_FAILED) { + if (nmc->print_output == NMC_PRINT_PRETTY) + nmc_terminal_erase_line (); + g_print (_("Error: Connection activation failed.")); + quit (); } else if (active && ac_state != NM_ACTIVE_CONNECTION_STATE_ACTIVATING) { g_string_printf (nmc->return_text, _("Error: Connection activation failed.")); nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; |