keyfile: quiet keyfile plugin when re-read connection is the same as in-memory one
It occurs, for example, when NM updates connection's timestamp.
This commit is contained in:

committed by
Jiří Klimeš

parent
57bef052ce
commit
c580444fd7
@@ -203,15 +203,18 @@ dir_changed (GFileMonitor *monitor,
|
|||||||
break;
|
break;
|
||||||
case G_FILE_MONITOR_EVENT_CREATED:
|
case G_FILE_MONITOR_EVENT_CREATED:
|
||||||
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
|
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
|
||||||
PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name);
|
|
||||||
|
|
||||||
if (connection) {
|
if (connection) {
|
||||||
/* Update */
|
/* Update */
|
||||||
NMKeyfileConnection *tmp;
|
NMKeyfileConnection *tmp;
|
||||||
|
|
||||||
tmp = nm_keyfile_connection_new (name, &error);
|
tmp = nm_keyfile_connection_new (name, &error);
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
|
if (!nm_connection_compare (NM_CONNECTION (connection),
|
||||||
|
NM_CONNECTION (tmp),
|
||||||
|
NM_SETTING_COMPARE_FLAG_EXACT)) {
|
||||||
|
PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name);
|
||||||
update_connection_settings (connection, tmp);
|
update_connection_settings (connection, tmp);
|
||||||
|
}
|
||||||
g_object_unref (tmp);
|
g_object_unref (tmp);
|
||||||
} else {
|
} else {
|
||||||
/* Error; remove the connection */
|
/* Error; remove the connection */
|
||||||
@@ -221,6 +224,8 @@ dir_changed (GFileMonitor *monitor,
|
|||||||
remove_connection (SC_PLUGIN_KEYFILE (config), connection, name);
|
remove_connection (SC_PLUGIN_KEYFILE (config), connection, name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
PLUGIN_PRINT (KEYFILE_PLUGIN_NAME, "updating %s", name);
|
||||||
|
|
||||||
/* New */
|
/* New */
|
||||||
connection = nm_keyfile_connection_new (name, &error);
|
connection = nm_keyfile_connection_new (name, &error);
|
||||||
if (connection) {
|
if (connection) {
|
||||||
|
Reference in New Issue
Block a user