libnm-core: don't warn about unrecognized properties

b64c82a3 removed the warning in libnm-util when
nm_setting_new_from_hash() sees an unrecognized property, but we were
still warning in the equivalent libnm-core code. But it doesn't make
sense to warn here either: we do add new properties sometimes, but we
always make sure that older clients still get the information they
need as well, so they can just ignore the new property.
This commit is contained in:
Dan Winship
2014-10-21 11:41:44 -04:00
parent d16905df63
commit f8dcb9510c

View File

@@ -716,8 +716,6 @@ _nm_setting_new_from_dbus (GType setting_type,
{ {
NMSettingClass *class; NMSettingClass *class;
NMSetting *setting; NMSetting *setting;
GVariantIter iter;
const char *prop_name;
const NMSettingProperty *properties; const NMSettingProperty *properties;
guint n_properties; guint n_properties;
guint i; guint i;
@@ -736,17 +734,11 @@ _nm_setting_new_from_dbus (GType setting_type,
*/ */
class = g_type_class_ref (setting_type); class = g_type_class_ref (setting_type);
/* Check for invalid properties first. */ /* Build the setting object from the properties we know about; we assume
g_variant_iter_init (&iter, setting_dict); * that any propreties in @setting_dict that we don't know about can
while (g_variant_iter_next (&iter, "{&sv}", &prop_name, NULL)) { * either be ignored or else has a backward-compatibility equivalent
if (!nm_setting_class_find_property (class, prop_name)) { * that we do know about.
/* Oh, we're so nice and only warn, maybe it should be a fatal error? */ */
g_warning ("Ignoring invalid property '%s'", prop_name);
continue;
}
}
/* Now build the setting object from the legitimate properties */
setting = (NMSetting *) g_object_new (setting_type, NULL); setting = (NMSetting *) g_object_new (setting_type, NULL);
properties = nm_setting_class_get_properties (class, &n_properties); properties = nm_setting_class_get_properties (class, &n_properties);