Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > d60bd1f35e0c82afb5f88d78afd23ee9 > files > 33

NetworkManager-0.7.0-9.el5.src.rpm

commit 47f4d9945e6c2d9df174ad4e6ffbe46852b3d1a3
Author: Dan Williams <dcbw@redhat.com>
Date:   Wed Feb 4 11:28:27 2009 -0500

    ifcfg-rh: silence message about ignoring loopback config (rh #484060)

diff -up NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c.foo NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
--- NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c.foo	2009-05-04 12:41:19.000000000 -0400
+++ NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.c	2009-05-04 12:41:38.000000000 -0400
@@ -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 *fil
 
 	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 -up NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h.foo NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h
--- NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h.foo	2009-05-04 12:41:24.000000000 -0400
+++ NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h	2009-05-04 12:41:38.000000000 -0400
@@ -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 -up NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/plugin.c.foo NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/plugin.c
--- NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/plugin.c.foo	2009-05-04 12:41:29.000000000 -0400
+++ NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/plugin.c	2009-05-04 12:41:38.000000000 -0400
@@ -160,10 +160,11 @@ read_one_connection (SCPluginIfcfg *plug
 	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 *plug
 		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 (SCPluginIfcf
 	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 (SCPluginIfcf
 
 	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 -up NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/reader.c.foo NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/reader.c
--- NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/reader.c.foo	2009-05-04 12:41:34.000000000 -0400
+++ NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/reader.c	2009-05-04 12:41:38.000000000 -0400
@@ -939,7 +939,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;
@@ -984,6 +985,7 @@ connection_from_file (const char *filena
 		}
 
 		if (!strcmp (device, "lo")) {
+			*ignore_error = TRUE;
 			g_set_error (error, ifcfg_plugin_error_quark (), 0,
 			             "Ignoring loopback device config.");
 			g_free (device);
diff -up NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/reader.h.foo NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/reader.h
--- NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/reader.h.foo	2009-05-04 12:53:46.000000000 -0400
+++ NetworkManager-0.7.0/system-settings/plugins/ifcfg-rh/reader.h	2009-05-04 12:54:13.000000000 -0400
@@ -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__ */