]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fixing some log messages
authorOliver Kurth <okurth@vmware.com>
Wed, 1 Apr 2020 18:34:06 +0000 (11:34 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 1 Apr 2020 18:34:06 +0000 (11:34 -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 159ce76323b1b26bb0e597886b7888428acbd76c..e49b87de7f05cf6a8baa615cb95585175cbdec79 100644 (file)
@@ -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);
       }
    }
index 2476e163a8832ff277d2cffb90e44d87c857e460..5c7f509657dc12ba50e6d2862076376d04d0ca12 100644 (file)
@@ -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__);