From: Aric Gardner Date: Wed, 27 Mar 2019 20:30:28 +0000 (-0400) Subject: Correct script exit condition. X-Git-Tag: v0.22.2~2^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F94%2F15094%2F3;p=releng%2Flftools.git Correct script exit condition. Logic error. When no votes where registered script would exit 0 Change-Id: Ie7dad776c737dcf5e5ed7a0c39b53f362eff980d Signed-off-by: Aric Gardner --- 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)