From 472d6b70366738e24a7451204be2847fad0448ae Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 20 2020 16:46:07 +0000 Subject: Adjust the topic used when a run finished It used to be True/False which isn't quite explicit, now it'll use: succeeded/failed which is likely more user-friendly. Rename the variable while at it, success = "failed" looked a little odd to @asaleh. Signed-off-by: Pierre-Yves Chibon --- diff --git a/runner.py b/runner.py index 7ef762e..3774f9a 100644 --- a/runner.py +++ b/runner.py @@ -67,13 +67,17 @@ def schedule(conf): ) output = monitor_gating_single_build.main(single_args) output_text = "\n".join(output) - success = "[FAILED]" not in output_text + output_text="\n".join(output) + if "[FAILED]" not in output_text: + result = "succeeded" + else: + result = "failed" notify( - topic=f"single-build.end.{success}", + topic=f"single-build.end.{result}", message={ "output": output, "output_text": output_text, - "success": success, + "result": result, } ) @@ -87,13 +91,16 @@ def schedule(conf): ) output = monitor_gating_multi_builds.main(multi_args) output_text = "\n".join(output) - success = "[FAILED]" not in output_text + if "[FAILED]" not in output_text: + result = "succeeded" + else: + result = "failed" notify( - topic=f"multi-build.end.{success}", + topic=f"multi-build.end.{result}", message={ "output": output, "output_text": output_text, - "success": success, + "result": result, } )