From 00961edb1ddef72d88f81c0030a1cde8b08d4ed6 Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Mon, 25 May 2020 15:00:58 -0400 Subject: [PATCH] Fix voting math Signed-off-by: Aric Gardner Change-Id: I450270710e67d08873f9bd40440417879f5f21c7 --- lftools/cli/infofile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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") -- 2.16.6