nmcli: fix handling of connection.down-on-poweroff property

Fix the following error:

  $ nmcli connection modify C connection.down-on-poweroff yes
  **
  nm:ERROR:../src/libnmc-setting/nm-meta-setting-desc.c:1367:_set_fcn_gobject_ternary: assertion failed: (_gobject_property_get_gtype(G_OBJECT(setting), property_info->property_name) == NM_TYPE_TERNARY)
  Bail out! nm:ERROR:../src/libnmc-setting/nm-meta-setting-desc.c:1367:_set_fcn_gobject_ternary: assertion failed: (_gobject_property_get_gtype(G_OBJECT(setting), property_info->property_name) == NM_TYPE_TERNARY)

Fixes: bd38a19832 ('connection: add support to down-on-poweroff')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2055
This commit is contained in:
Beniamino Galvani
2024-10-17 18:39:48 +02:00
parent 3cb9991fc8
commit 4af6cf592a
2 changed files with 3 additions and 3 deletions

View File

@@ -5635,7 +5635,7 @@ static const NMMetaPropertyInfo *const property_infos_CONNECTION[] = {
.property_type = &_pt_gobject_enum,
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_DOWN_ON_POWEROFF,
.property_type = &_pt_gobject_ternary,
.property_type = &_pt_gobject_enum,
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_SECONDARIES,
.describe_message =

View File

@@ -693,8 +693,8 @@
values="default (-1), false (0), true (1)" />
<property name="down-on-poweroff"
nmcli-description="Whether the connection will be brought down before the system is powered off. The default value is &quot;default&quot; (-1). When the default value is specified, then the global value from NetworkManager configuration is looked up, if not set, it is considered as &quot;no&quot; (0)."
format="ternary"
values="true/yes/on, false/no/off, default/unknown" />
format="choice (NMSettingConnectionDownOnPoweroff)"
values="default (-1), no (0), yes (1)" />
<property name="secondaries"
nmcli-description="List of connection UUIDs that should be activated when the base connection itself is activated. Currently, only VPN connections are supported."
format="list of strings" />