mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 06:28:05 +02:00
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.
This commit is contained in:
parent
f027b71f65
commit
a06487a6ae
1 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue