mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
nmcli: fix return code on "nmcli device connect" error
Before: $ nmcli device connect veth0; echo $? Error: Connection activation failed: (5) IP configuration could not be reserved (no available address, timeout, etc.). 0 After $ nmcli device connect veth0; echo $? Error: Connection activation failed: (5) IP configuration could not be reserved (no available address, timeout, etc.). 4 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/902
This commit is contained in:
parent
88f5e7518a
commit
5cf9395b94
|
@ -2132,9 +2132,11 @@ connected_state_cb(AddAndActivateInfo *info)
|
||||||
_("Hint: \"nmcli dev wifi show-password\" shows the Wi-Fi name and password.\n"));
|
_("Hint: \"nmcli dev wifi show-password\" shows the Wi-Fi name and password.\n"));
|
||||||
} else if (state <= NM_DEVICE_STATE_DISCONNECTED || state >= NM_DEVICE_STATE_DEACTIVATING) {
|
} else if (state <= NM_DEVICE_STATE_DISCONNECTED || state >= NM_DEVICE_STATE_DEACTIVATING) {
|
||||||
reason = nm_device_get_state_reason(info->device);
|
reason = nm_device_get_state_reason(info->device);
|
||||||
g_print(_("Error: Connection activation failed: (%d) %s.\n"),
|
g_string_printf(info->nmc->return_text,
|
||||||
reason,
|
_("Error: Connection activation failed: (%d) %s."),
|
||||||
gettext(nmc_device_reason_to_string(reason)));
|
reason,
|
||||||
|
gettext(nmc_device_reason_to_string(reason)));
|
||||||
|
info->nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue