summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-06-01 16:48:19 +0200
committerThomas Haller <thaller@redhat.com>2017-06-01 16:56:27 +0200
commit8a74ab1e9f368d68f16bddf6c0fc5c23f14aad10 (patch)
treecc035fcb46b060f8428fef1d7e36b2f9506ce7b4
parentc0419257e70cc64c889a9a906445a74efb92dc44 (diff)
downloadNetworkManager-8a74ab1e9f368d68f16bddf6c0fc5c23f14aad10.tar.gz
core: print the connection.type in nm_utils_log_connection_diff()
-rw-r--r--src/nm-core-utils.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
index 4da1fb2c68..2f4e525be2 100644
--- a/src/nm-core-utils.c
+++ b/src/nm-core-utils.c
@@ -2434,10 +2434,14 @@ nm_utils_log_connection_diff (NMConnection *connection, NMConnection *diff_base,
connection_diff_are_same = nm_connection_diff (connection, diff_base, NM_SETTING_COMPARE_FLAG_EXACT | NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT, &connection_diff);
if (connection_diff_are_same) {
- if (diff_base)
- nm_log (level, domain, NULL, NULL, "%sconnection '%s' (%p/%s and %p/%s): no difference", prefix, name, connection, G_OBJECT_TYPE_NAME (connection), diff_base, G_OBJECT_TYPE_NAME (diff_base));
- else
- nm_log (level, domain, NULL, NULL, "%sconnection '%s' (%p/%s): no properties set", prefix, name, connection, G_OBJECT_TYPE_NAME (connection));
+ const char *t1, *t2;
+
+ t1 = nm_connection_get_connection_type (connection);
+ if (diff_base) {
+ t2 = nm_connection_get_connection_type (diff_base);
+ nm_log (level, domain, NULL, NULL, "%sconnection '%s' (%p/%s/%s%s%s and %p/%s/%s%s%s): no difference", prefix, name, connection, G_OBJECT_TYPE_NAME (connection), NM_PRINT_FMT_QUOTE_STRING (t1), diff_base, G_OBJECT_TYPE_NAME (diff_base), NM_PRINT_FMT_QUOTE_STRING (t2));
+ } else
+ nm_log (level, domain, NULL, NULL, "%sconnection '%s' (%p/%s/%s%s%s): no properties set", prefix, name, connection, G_OBJECT_TYPE_NAME (connection), NM_PRINT_FMT_QUOTE_STRING (t1));
g_assert (!connection_diff);
return;
}
@@ -2471,12 +2475,19 @@ nm_utils_log_connection_diff (NMConnection *connection, NMConnection *diff_base,
if (print_header) {
GError *err_verify = NULL;
const char *path = nm_connection_get_path (connection);
+ const char *t1, *t2;
+ t1 = nm_connection_get_connection_type (connection);
if (diff_base) {
- nm_log (level, domain, NULL, NULL, "%sconnection '%s' (%p/%s < %p/%s)%s%s%s:", prefix, name, connection, G_OBJECT_TYPE_NAME (connection), diff_base, G_OBJECT_TYPE_NAME (diff_base),
+ t2 = nm_connection_get_connection_type (diff_base);
+ nm_log (level, domain, NULL, NULL, "%sconnection '%s' (%p/%s/%s%s%s < %p/%s/%s%s%s)%s%s%s:",
+ prefix, name,
+ connection, G_OBJECT_TYPE_NAME (connection), NM_PRINT_FMT_QUOTE_STRING (t1),
+ diff_base, G_OBJECT_TYPE_NAME (diff_base), NM_PRINT_FMT_QUOTE_STRING (t2),
NM_PRINT_FMT_QUOTED (path, " [", path, "]", ""));
} else {
- nm_log (level, domain, NULL, NULL, "%sconnection '%s' (%p/%s):%s%s%s", prefix, name, connection, G_OBJECT_TYPE_NAME (connection),
+ nm_log (level, domain, NULL, NULL, "%sconnection '%s' (%p/%s/%s%s%s):%s%s%s", prefix, name, connection, G_OBJECT_TYPE_NAME (connection),
+ NM_PRINT_FMT_QUOTE_STRING (t1),
NM_PRINT_FMT_QUOTED (path, " [", path, "]", ""));
}
print_header = FALSE;