From: Oliver Kurth Date: Wed, 1 Apr 2020 18:31:37 +0000 (-0700) Subject: Fixing some log messages X-Git-Tag: stable-11.2.0~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b911e5c94cd18b7985e920875249d2314029f0a6;p=thirdparty%2Fopen-vm-tools.git Fixing some log messages 1. PublishScriptOutputToNamespaceDB can fail for various reasons, caller can't know exact reason from return values, so just printing that the function failed in case return value is FALSE. Exact cause must be inferred from the function's logs itself. 2. Printing log for chunkCount only if we successfully wrote it in NDB --- diff --git a/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c b/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c index 2f2c7f3fd..101e80199 100644 --- a/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c +++ b/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c @@ -539,7 +539,7 @@ ServiceDiscoveryTask(ToolsAppCtx *ctx, for (i = 0; i < gFullPaths->len; i++) { KeyNameValue tmp = g_array_index(gFullPaths, KeyNameValue, i); if (!PublishScriptOutputToNamespaceDB(ctx, tmp.keyName, tmp.val)) { - g_debug("%s: Failed to execute script %s or script output was empty", + g_debug("%s: PublishScriptOutputToNamespaceDB failed for script %s\n", __FUNCTION__, tmp.val); } } diff --git a/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c b/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c index 686a8bdce..2b1b9d371 100644 --- a/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c +++ b/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c @@ -171,7 +171,9 @@ PublishScriptOutputToNamespaceDB(ToolsAppCtx *ctx, if (status) { gchar *chunkCount = g_strdup_printf("%d", i); status = WriteData(ctx, key, chunkCount, strlen(chunkCount)); - g_debug("%s: Written key %s chunks %s\n", __FUNCTION__, key, chunkCount); + if (status) { + g_debug("%s: Written key %s chunks %s\n", __FUNCTION__, key, chunkCount); + } g_free(chunkCount); } else if (!stdoutIsEmpty) { g_warning("%s: Was not able to capture or store data\n", __FUNCTION__);