cli: fix metered to string property

nmc_property_connection_get_metered() must return non-localized strings
that can be parsed by nmc_property_connection_set_metered().

Fixes: f0aebfd746
(cherry picked from commit 5eba53cd53)
This commit is contained in:
Thomas Haller 2015-06-10 11:49:04 +02:00 committed by Beniamino Galvani
parent 586bb2799f
commit 1615d8c975

View file

@ -2752,6 +2752,17 @@ nmc_property_connection_get_metered (NMSetting *setting, NmcPropertyGetType get_
{
NMSettingConnection *s_conn = NM_SETTING_CONNECTION (setting);
if (get_type == NMC_PROPERTY_GET_PARSABLE) {
switch (nm_setting_connection_get_metered (s_conn)) {
case NM_METERED_YES:
return g_strdup ("yes");
case NM_METERED_NO:
return g_strdup ("no");
case NM_METERED_UNKNOWN:
default:
return g_strdup ("unknown");
}
}
switch (nm_setting_connection_get_metered (s_conn)) {
case NM_METERED_YES:
return g_strdup (_("yes"));