cli: fix shell completion for connection.type to show "ovs-{dpkg,patch}"

nmcli --complete-args connection add type ''

would not show "ovs-{dpdk,patch}", because the conditions about what
makes a base type are not consistent with what NMSettingConnection's
verify() does.

Fix that.
This commit is contained in:
Thomas Haller 2020-11-16 09:59:15 +01:00
parent ac7915b3ce
commit 9ebeeb6bf2
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -2561,9 +2561,10 @@ static const char *const *_complete_fcn_connection_type(ARGS_COMPLETE_FCN)
for (i = 0, j = 0; i < _NM_META_SETTING_TYPE_NUM; i++) {
const NMMetaSettingInfoEditor *setting_info = &nm_meta_setting_infos_editor[i];
GType gtype = setting_info->general->get_setting_gtype();
const char * v;
if (!setting_info->valid_parts)
if (_nm_setting_type_get_base_type_priority(gtype) == NM_SETTING_PRIORITY_INVALID)
continue;
v = setting_info->alias;