diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index 14468b02ff..3589cffd63 100644 --- a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -242,7 +242,8 @@ NMIfcfgConnection * nm_ifcfg_connection_new (const char *filename, DBusGConnection *g_connection, NMSystemConfigHalManager *hal_mgr, - GError **error) + GError **error, + gboolean *ignore_error) { GObject *object; NMIfcfgConnectionPrivate *priv; @@ -254,7 +255,7 @@ nm_ifcfg_connection_new (const char *filename, g_return_val_if_fail (filename != NULL, NULL); - wrapped = connection_from_file (filename, &unmanaged, &keyfile, error); + wrapped = connection_from_file (filename, &unmanaged, &keyfile, error, ignore_error); if (!wrapped) return NULL; diff --git a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h index 84ee4d2e5b..9a6e7c5e5d 100644 --- a/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h +++ b/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h @@ -50,7 +50,8 @@ GType nm_ifcfg_connection_get_type (void); NMIfcfgConnection *nm_ifcfg_connection_new (const char *filename, DBusGConnection *g_connection, NMSystemConfigHalManager *hal_mgr, - GError **error); + GError **error, + gboolean *ignore_error); const char *nm_ifcfg_connection_get_filename (NMIfcfgConnection *self); diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index 6efd673a72..e4f5bcfd7c 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -160,10 +160,11 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename) SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin); NMIfcfgConnection *connection; GError *error = NULL; + gboolean ignore_error = FALSE; PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "parsing %s ... ", filename); - connection = nm_ifcfg_connection_new (filename, priv->g_connection, priv->hal_mgr, &error); + connection = nm_ifcfg_connection_new (filename, priv->g_connection, priv->hal_mgr, &error, &ignore_error); if (connection) { NMConnection *wrapped; NMSettingConnection *s_con; @@ -198,8 +199,10 @@ read_one_connection (SCPluginIfcfg *plugin, const char *filename) g_signal_connect (G_OBJECT (connection), "ifcfg-changed", G_CALLBACK (connection_ifcfg_changed), plugin); } else { - PLUGIN_PRINT (IFCFG_PLUGIN_NAME, " error: %s", - (error && error->message) ? error->message : "(unknown)"); + if (!ignore_error) { + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, " error: %s", + (error && error->message) ? error->message : "(unknown)"); + } g_error_free (error); } @@ -284,7 +287,7 @@ connection_changed_handler (SCPluginIfcfg *plugin, NMIfcfgConnection *tmp; GError *error = NULL; GHashTable *settings; - gboolean new_unmanaged, old_unmanaged; + gboolean new_unmanaged, old_unmanaged, ignore_error = FALSE; g_return_if_fail (plugin != NULL); g_return_if_fail (path != NULL); @@ -294,12 +297,16 @@ connection_changed_handler (SCPluginIfcfg *plugin, PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "updating %s", path); - tmp = (NMIfcfgConnection *) nm_ifcfg_connection_new (path, priv->g_connection, priv->hal_mgr, &error); + tmp = (NMIfcfgConnection *) nm_ifcfg_connection_new (path, priv->g_connection, + priv->hal_mgr, + &error, + &ignore_error); if (!tmp) { - /* couldn't read connection; remove it */ - - PLUGIN_WARN (IFCFG_PLUGIN_NAME, " error: %s", - error->message ? error->message : "(unknown)"); + /* errors reading connection; remove it */ + if (!ignore_error) { + PLUGIN_WARN (IFCFG_PLUGIN_NAME, " error: %s", + error->message ? error->message : "(unknown)"); + } g_error_free (error); PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", path); diff --git a/system-settings/plugins/ifcfg-rh/reader.c b/system-settings/plugins/ifcfg-rh/reader.c index 0fedcbe5df..ded790bb03 100644 --- a/system-settings/plugins/ifcfg-rh/reader.c +++ b/system-settings/plugins/ifcfg-rh/reader.c @@ -938,7 +938,8 @@ NMConnection * connection_from_file (const char *filename, gboolean *ignored, char **keyfile, - GError **error) + GError **error, + gboolean *ignore_error) { NMConnection *connection = NULL; NMSettingConnection *s_con; @@ -983,6 +984,7 @@ connection_from_file (const char *filename, } if (!strcmp (device, "lo")) { + *ignore_error = TRUE; g_set_error (error, ifcfg_plugin_error_quark (), 0, "Ignoring loopback device config."); g_free (device); diff --git a/system-settings/plugins/ifcfg-rh/reader.h b/system-settings/plugins/ifcfg-rh/reader.h index fa51215afb..11eb6fc83e 100644 --- a/system-settings/plugins/ifcfg-rh/reader.h +++ b/system-settings/plugins/ifcfg-rh/reader.h @@ -27,6 +27,7 @@ NMConnection *connection_from_file (const char *filename, gboolean *ignored, char **keyfile, - GError **error); + GError **error, + gboolean *ignore_error); #endif /* __READER_H__ */