diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2022-06-24 00:30:04 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2022-06-24 00:30:04 +0200 |
commit | 647e2553627d38f6a7c254d162cc9ea697c662f1 (patch) | |
tree | e140a1d729bb138d05edd9e043452062dd282840 | |
parent | e3fa6dfd7f02c648732be811d540aa7dbcf4ffdc (diff) |
nmcli/connections: make sure the connection has a base setting
Do the same bookkeeping as would happen upon setting the "type" option
when the connection has a connection.type set upon its addition.
Otherwise the --ask mode is sad:
$ nmcli --ask c add connection.type team
** nm:ERROR:src/nmcli/connections.c:5648:connection_get_base_meta_setting_type: assertion failed: (base_setting)
Bail out! nm:ERROR:src/nmcli/connections.c:5648:connection_get_base_meta_setting_type: assertion failed: (base_setting)
Aborted (core dumped)
-rw-r--r-- | src/nmcli/connections.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index ae2cd71d61..3370277ae2 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -5891,6 +5891,12 @@ read_properties: if (nmc->complete) goto finish; + if (!enable_type_settings_and_options(connection, &error)) { + g_string_assign(nmc->return_text, error->message); + nmc->return_value = error->code; + goto finish; + } + /* Now ask user for the rest of the mandatory options. */ if (nmc->ask) questionnaire_mandatory(nmc, connection); |