From a9c4fc3de0d02592e3b3f3bb7a930f2f467b96cd Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Wed, 27 Mar 2019 16:30:28 -0400 Subject: [PATCH] Correct script exit condition. Logic error. When no votes where registered script would exit 0 Change-Id: Ie7dad776c737dcf5e5ed7a0c39b53f362eff980d Signed-off-by: Aric Gardner --- lftools/cli/infofile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lftools/cli/infofile.py b/lftools/cli/infofile.py index c12c25bb..31fcf548 100644 --- a/lftools/cli/infofile.py +++ b/lftools/cli/infofile.py @@ -183,6 +183,10 @@ def check_votes(ctx, info_file, gerrit_url, change_number, tsc): log.info(have_not_voted) log.info(have_not_voted_length) + if (have_voted_length == 0): + log.info("No one has voted:") + sys.exit(1) + if (have_voted_length != 0): majority = (committer_lenght / have_voted_length) -- 2.16.6