diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c index caa1f4ba2..ec143edd0 100644 --- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c +++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c @@ -102,8 +102,7 @@ files_changed_cb (NMInotifyHelper *ih, NMIfcfgConnection * nm_ifcfg_connection_new (NMConnection *source, const char *full_path, - GError **error, - gboolean *ignore_error) + GError **error) { GObject *object; NMConnection *tmp; @@ -119,8 +118,7 @@ nm_ifcfg_connection_new (NMConnection *source, else { tmp = connection_from_file (full_path, &unhandled_spec, - error, - ignore_error); + error); if (!tmp) return NULL; @@ -259,7 +257,7 @@ commit_changes (NMSettingsConnection *connection, * it if it's really changed. */ if (priv->path) { - reread = connection_from_file (priv->path, NULL, NULL, NULL); + reread = connection_from_file (priv->path, NULL, NULL); if (reread) { same = nm_connection_compare (NM_CONNECTION (connection), reread, diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h index 37eacaf0d..58576d9d1 100644 --- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h +++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.h @@ -48,8 +48,7 @@ GType nm_ifcfg_connection_get_type (void); NMIfcfgConnection *nm_ifcfg_connection_new (NMConnection *source, const char *full_path, - GError **error, - gboolean *ignore_error); + GError **error); const char *nm_ifcfg_connection_get_path (NMIfcfgConnection *self); diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c index 2dced56b4..60ffcc7f8 100644 --- a/src/settings/plugins/ifcfg-rh/plugin.c +++ b/src/settings/plugins/ifcfg-rh/plugin.c @@ -129,23 +129,13 @@ _internal_new_connection (SCPluginIfcfg *self, SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self); NMIfcfgConnection *connection; const char *cid; - GError *local = NULL; - gboolean ignore_error = FALSE; if (!source) nm_log_info (LOGD_SETTINGS, "parsing %s ... ", path); - connection = nm_ifcfg_connection_new (source, path, &local, &ignore_error); - if (!connection) { - if (!ignore_error) - nm_log_warn (LOGD_SETTINGS, " %s", (local && local->message) ? local->message : "(unknown)"); - if (local) - g_propagate_error (error, local); - else - g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, - "(unknown)"); + connection = nm_ifcfg_connection_new (source, path, error); + if (!connection) return NULL; - } cid = nm_connection_get_id (NM_CONNECTION (connection)); g_assert (cid); @@ -248,7 +238,6 @@ connection_new_or_changed (SCPluginIfcfg *self, SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (self); NMIfcfgConnection *new; GError *error = NULL; - gboolean ignore_error = FALSE; const char *new_unmanaged = NULL, *old_unmanaged = NULL; const char *new_unrecognized = NULL, *old_unrecognized = NULL; gboolean unmanaged_changed, unrecognized_changed; @@ -285,13 +274,9 @@ connection_new_or_changed (SCPluginIfcfg *self, return; } - new = (NMIfcfgConnection *) nm_ifcfg_connection_new (NULL, path, &error, &ignore_error); + new = (NMIfcfgConnection *) nm_ifcfg_connection_new (NULL, path, NULL); if (!new) { /* errors reading connection; remove it */ - if (!ignore_error) - nm_log_warn (LOGD_SETTINGS, " %s", (error && error->message) ? error->message : "(unknown)"); - g_clear_error (&error); - nm_log_info (LOGD_SETTINGS, "removed %s.", path); remove_connection (self, existing); return; diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 1c2b566d1..171fb1339 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -4842,14 +4842,19 @@ done: NMConnection * connection_from_file (const char *filename, char **out_unhandled, - GError **error, - gboolean *out_ignore_error) + GError **error) { - return connection_from_file_full (filename, NULL, NULL, + gboolean ignore_error = FALSE; + NMConnection *conn; + + conn = connection_from_file_full (filename, NULL, NULL, out_unhandled, NULL, NULL, NULL, error, - out_ignore_error); + &ignore_error); + if (error && *error && !ignore_error) + PARSE_WARNING ("%s", (*error)->message); + return conn; } NMConnection * diff --git a/src/settings/plugins/ifcfg-rh/reader.h b/src/settings/plugins/ifcfg-rh/reader.h index 7fafc5678..15d5bac36 100644 --- a/src/settings/plugins/ifcfg-rh/reader.h +++ b/src/settings/plugins/ifcfg-rh/reader.h @@ -28,8 +28,7 @@ NMConnection *connection_from_file (const char *filename, char **out_unhandled, - GError **error, - gboolean *out_ignore_error); + GError **error); char *uuid_from_file (const char *filename);