Skip to contentSkip to conversation

usertools/telemetry-watcher: fix hang on startup

PATCH Applied Bruce Richardson 2 participants 2 messages Sep 9 – Nov 2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usertools/telemetry-watcher: fix hang on startup

Commit cbfdffb1083d ("usertools/telemetry: load aliases from config directory") added an extra printed output line to startup of the dpdk-telemetry script when an alias file was loaded. This confuses the wrapper script dpdk-telemetry-watcher, causing it to hang on startup. Only print out the message when script is run interactively.

Fixes cbfdffb1083d ("usertools/telemetry: load aliases from config directory")
---
 usertools/dpdk-telemetry.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
usertools/dpdk-telemetry.py +3 -1
index e575f269cb..b4dd789143 100755
@@ -98,7 +98,9 @@ def load_aliases(alias_path=None):
     except OSError as e:
         print("Warning: failed to read {}: {}".format(alias_path, e), file=sys.stderr)
 
-    print("Loaded {} aliases from {}".format(len(aliases), alias_path))
+    # only print this informational message in interactive mode
+    if os.isatty(sys.stdin.fileno()):
+        print("Loaded {} aliases from {}".format(len(aliases), alias_path))
     return aliases
 
 
Signature · 1 line
2.53.0
#1 lore raw
Quoted 11 lines · Bruce Richardson

Commit cbfdffb1083d ("usertools/telemetry: load aliases from config directory") added an extra printed output line to startup of the dpdk-telemetry script when an alias file was loaded. This confuses the wrapper script dpdk-telemetry-watcher, causing it to hang on startup. Only print out the message when script is run interactively.

Fixes cbfdffb1083d ("usertools/telemetry: load aliases from config directory")

Applied, thanks.

Signature · 1 line
David Marchand