From: Aric Gardner Date: Mon, 25 May 2020 19:00:58 +0000 (-0400) Subject: Fix voting math X-Git-Tag: v0.33.1~1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F64077%2F4;p=releng%2Flftools.git Fix voting math Signed-off-by: Aric Gardner Change-Id: I450270710e67d08873f9bd40440417879f5f21c7 --- diff --git a/lftools/cli/infofile.py b/lftools/cli/infofile.py index 62309c75..6b7c9172 100644 --- a/lftools/cli/infofile.py +++ b/lftools/cli/infofile.py @@ -317,7 +317,7 @@ def check_votes(ctx, info_file, endpoint, change_number, tsc, github_repo): have_voted_length = len(have_voted) log.info("Number of Committers:") log.info(len(info_committers)) - committer_lenght = len(info_committers) + committer_length = len(info_committers) log.info("Committers that have voted:") log.info(have_voted) log.info(have_voted_length) @@ -330,8 +330,8 @@ def check_votes(ctx, info_file, endpoint, change_number, tsc, github_repo): sys.exit(1) if have_voted_length != 0: - majority = committer_lenght / have_voted_length - if majority >= 1: + majority = have_voted_length / committer_length + if majority >= 0.5: log.info("Majority committer vote reached") if tsc: log.info("Need majority of tsc")