settings: move warning about ifcfg-rh
Move the warning about the presence of ifcfg-rh profiles from the plugin to NMSettings. In this way, it will be easier to implement the migration option in the next commit.
This commit is contained in:

committed by
Fernando Fernandez Mancera

parent
52cca91dd2
commit
5e75f0c197
@@ -1469,10 +1469,15 @@ static void
|
||||
_plugin_connections_reload(NMSettings *self)
|
||||
{
|
||||
NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE(self);
|
||||
GSList *iter;
|
||||
GSList *iter_plugin;
|
||||
GHashTableIter iter_entry;
|
||||
SettConnEntry *entry;
|
||||
gboolean warned = FALSE;
|
||||
|
||||
for (iter = priv->plugins; iter; iter = iter->next) {
|
||||
nm_settings_plugin_reload_connections(iter->data, _plugin_connections_reload_cb, self);
|
||||
for (iter_plugin = priv->plugins; iter_plugin; iter_plugin = iter_plugin->next) {
|
||||
nm_settings_plugin_reload_connections(iter_plugin->data,
|
||||
_plugin_connections_reload_cb,
|
||||
self);
|
||||
}
|
||||
|
||||
_connection_changed_process_all_dirty(
|
||||
@@ -1485,8 +1490,26 @@ _plugin_connections_reload(NMSettings *self)
|
||||
| NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_AGENT_SECRETS
|
||||
| NM_SETTINGS_CONNECTION_UPDATE_REASON_UPDATE_NON_SECRET);
|
||||
|
||||
for (iter = priv->plugins; iter; iter = iter->next)
|
||||
nm_settings_plugin_load_connections_done(iter->data);
|
||||
for (iter_plugin = priv->plugins; iter_plugin; iter_plugin = iter_plugin->next)
|
||||
nm_settings_plugin_load_connections_done(iter_plugin->data);
|
||||
|
||||
g_hash_table_iter_init(&iter_entry, priv->sce_idx);
|
||||
while (g_hash_table_iter_next(&iter_entry, (gpointer *) &entry, NULL)) {
|
||||
const char *plugin;
|
||||
|
||||
plugin = nm_settings_plugin_get_plugin_name(nm_settings_storage_get_plugin(entry->storage));
|
||||
|
||||
if (nm_streq0(plugin, "ifcfg-rh")) {
|
||||
if (!warned) {
|
||||
nm_log_info(
|
||||
LOGD_SETTINGS,
|
||||
"Warning: the ifcfg-rh plugin is deprecated, please migrate connections "
|
||||
"to the keyfile format using \"nmcli connection migrate\"");
|
||||
warned = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@@ -52,8 +52,6 @@ typedef struct {
|
||||
|
||||
GHashTable *unmanaged_specs;
|
||||
GHashTable *unrecognized_specs;
|
||||
|
||||
gboolean warned;
|
||||
} NMSIfcfgRHPluginPrivate;
|
||||
|
||||
struct _NMSIfcfgRHPlugin {
|
||||
@@ -178,7 +176,6 @@ nm_assert_self(NMSIfcfgRHPlugin *self, gboolean unhandled_specs_consistent)
|
||||
static NMSIfcfgRHStorage *
|
||||
_load_file(NMSIfcfgRHPlugin *self, const char *filename, GError **error)
|
||||
{
|
||||
NMSIfcfgRHPluginPrivate *priv = NMS_IFCFG_RH_PLUGIN_GET_PRIVATE(self);
|
||||
NMSIfcfgRHStorage *ret = NULL;
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
gs_free_error GError *load_error = NULL;
|
||||
@@ -236,13 +233,6 @@ _load_file(NMSIfcfgRHPlugin *self, const char *filename, GError **error)
|
||||
&st.st_mtim);
|
||||
}
|
||||
|
||||
if (!priv->warned) {
|
||||
nm_log_info(_NMLOG_DOMAIN,
|
||||
"Warning: the ifcfg-rh plugin is deprecated, please migrate connections "
|
||||
"to the keyfile format using \"nmcli connection migrate\".");
|
||||
priv->warned = TRUE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user