]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fixing some log messages
authorOliver Kurth <okurth@vmware.com>
Wed, 1 Apr 2020 18:31:37 +0000 (11:31 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 1 Apr 2020 18:31:37 +0000 (11:31 -0700)
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

open-vm-tools/services/plugins/serviceDiscovery/serviceDiscovery.c
open-vm-tools/services/plugins/serviceDiscovery/serviceDiscoveryPosix.c

index 2f2c7f3fd1fef2db31c888aa29cd95d884c540cf..101e801998f3f253317c25454ea5d0fd47fdc738 100644 (file)
@@ -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);
       }
    }
index 686a8bdcef1be08ed2082e7e1d54376d2504b972..2b1b9d3718ff62813ccc2447bf9e137865e89d8c 100644 (file)
@@ -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__);