nmcli: allow adding 'generic' connections via nmcli connection add

'nmcli connection edit' already allows adding and editing generic connections
(added by 2a2af5825a).
This commit is contained in:
Jiří Klimeš 2015-02-10 15:33:35 +01:00
parent 6994454461
commit 0ff9b75387

View file

@ -3990,6 +3990,7 @@ complete_connection_by_type (NMConnection *connection,
GError **error)
{
NMSettingConnection *s_con;
NMSettingGeneric *s_generic;
NMSettingWired *s_wired;
NMSettingInfiniband *s_infiniband;
NMSettingWireless *s_wifi;
@ -5216,6 +5217,10 @@ cleanup_olpc:
if (!success)
return FALSE;
} else if (!strcmp (con_type, NM_SETTING_GENERIC_SETTING_NAME)) {
/* Add 'generic' setting */
s_generic = (NMSettingGeneric *) nm_setting_generic_new ();
nm_connection_add_setting (connection, NM_SETTING (s_generic));
} else {
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
_("Error: '%s' is not a valid connection type."),