mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 17:40:08 +01:00
cli: fix error parsing input arguments in non-interactive mode
Causes the following failure:
$ /bin/nmcli connection add type ethernet con-name connie ifname '*'
(process:13883): GLib-CRITICAL **: g_strchug: assertion `string != NULL' failed
(process:13883): GLib-CRITICAL **: g_strchomp: assertion `string != NULL' failed
Error: invalid connection type; '' not among [generic, ...].
Regression introduced by commit bfb1200b4f.
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
5fa1248a2f
commit
bcb9f6c910
1 changed files with 4 additions and 2 deletions
|
|
@ -4798,7 +4798,8 @@ cleanup_bridge_slave:
|
|||
_("Error: 'vpn-type' is required."));
|
||||
goto cleanup_vpn;
|
||||
}
|
||||
vpn_type = g_strstrip (vpn_type_ask);
|
||||
if (vpn_type_ask)
|
||||
vpn_type = g_strstrip (vpn_type_ask);
|
||||
|
||||
if (!(st = nmc_string_is_valid (vpn_type, nmc_known_vpns, NULL))) {
|
||||
printf (_("Warning: 'vpn-type': %s not known.\n"), vpn_type);
|
||||
|
|
@ -5218,7 +5219,8 @@ do_connection_add (NmCli *nmc, int argc, char **argv)
|
|||
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
|
||||
goto error;
|
||||
}
|
||||
type = g_strstrip (type_ask);
|
||||
if (type_ask)
|
||||
type = g_strstrip (type_ask);
|
||||
|
||||
if (!(setting_name = check_valid_name (type, nmc_valid_connection_types, &error))) {
|
||||
g_string_printf (nmc->return_text, _("Error: invalid connection type; %s."),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue