From 96dd71bbdd4515ce33bd39c213ad9d96d453c76b Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 3 Dec 2017 19:23:29 +0000 Subject: [PATCH] Make sending the output of the dist command configurable --- .gitignore | 1 + example.json | 1 + threshold | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1c8959f..7361a72 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ *.pem config.json pool.json +dist.sh env/ diff --git a/example.json b/example.json index f7ba8a9..fcc89a3 100644 --- a/example.json +++ b/example.json @@ -8,6 +8,7 @@ "ConnectOnCreate": false, "HighlightNotifications": true, "DistEnabled": true, + "SendDistOutput": false, "Password": "s", "Default": { "password": null, diff --git a/threshold b/threshold index 000b039..ad9faa8 100755 --- a/threshold +++ b/threshold @@ -471,7 +471,10 @@ class Helper(object): elif cmd == "dist": if config["DistEnabled"]: rtrn = run(["./dist.sh"], shell=True, stdout=PIPE) - info("Exit code: %s -- Stdout: %s" % (rtrn.returncode, rtrn.stdout)) + if config["SendDistOutput"]: + info("Exit code: %s -- Stdout: %s" % (rtrn.returncode, rtrn.stdout)) + else: + info("Exit code: %s" % rtrn.returncode) else: failure("The dist command is not enabled") return