summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-07-17 10:50:42 +0200
committerThomas Haller <thaller@redhat.com>2015-07-24 11:04:01 +0200
commitc0b03debc8dca9b68f9762a98773eb3c3e81e40e (patch)
tree9f7ca55f65b3b6c8bdab94a6cbc46a8521a7ffcb
parentc863d2ad0fb27d1ea39c4035e0683a86cfb911f3 (diff)
downloadNetworkManager-c0b03debc8dca9b68f9762a98773eb3c3e81e40e.tar.gz
keyfile: add info logging when updating connection
-rw-r--r--src/settings/plugins/keyfile/nm-keyfile-connection.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/settings/plugins/keyfile/nm-keyfile-connection.c b/src/settings/plugins/keyfile/nm-keyfile-connection.c
index 11762ee602..c631faee5c 100644
--- a/src/settings/plugins/keyfile/nm-keyfile-connection.c
+++ b/src/settings/plugins/keyfile/nm-keyfile-connection.c
@@ -33,6 +33,9 @@
#include "reader.h"
#include "writer.h"
#include "common.h"
+#include "utils.h"
+#include "gsystem-local-alloc.h"
+#include "nm-logging.h"
G_DEFINE_TYPE (NMKeyfileConnection, nm_keyfile_connection, NM_TYPE_SETTINGS_CONNECTION)
@@ -104,11 +107,26 @@ commit_changes (NMSettingsConnection *connection,
}
/* Update the filename if it changed */
- if (path) {
+ if ( path
+ && g_strcmp0 (path, nm_settings_connection_get_filename (connection)) != 0) {
+ gs_free char *old_path = g_strdup (nm_settings_connection_get_filename (connection));
+
nm_settings_connection_set_filename (connection, path);
- g_free (path);
+ if (old_path) {
+ nm_log_info (LOGD_SETTINGS, "keyfile: update "NM_KEYFILE_CONNECTION_LOG_FMT" and rename from \"%s\"",
+ NM_KEYFILE_CONNECTION_LOG_ARG (connection),
+ old_path);
+ } else {
+ nm_log_info (LOGD_SETTINGS, "keyfile: update "NM_KEYFILE_CONNECTION_LOG_FMT" and persist connection",
+ NM_KEYFILE_CONNECTION_LOG_ARG (connection));
+ }
+ } else {
+ nm_log_info (LOGD_SETTINGS, "keyfile: update "NM_KEYFILE_CONNECTION_LOG_FMT,
+ NM_KEYFILE_CONNECTION_LOG_ARG (connection));
}
+ g_free (path);
+
NM_SETTINGS_CONNECTION_CLASS (nm_keyfile_connection_parent_class)->commit_changes (connection,
callback,
user_data);