From: Oliver Kurth Date: Wed, 1 Apr 2020 18:34:06 +0000 (-0700) Subject: Fixing some log messages X-Git-Tag: stable-11.1.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f499635a68ca5811f534cb1482ad2847842e462;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 159ce7632..e49b87de7 100644 --- a/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c +++ b/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c @@ -478,7 +478,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 2476e163a..5c7f50965 100644 --- a/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c +++ b/open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c @@ -170,7 +170,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__);