Fix voting math 77/64077/4
authorAric Gardner <agardner@linuxfoundation.org>
Mon, 25 May 2020 19:00:58 +0000 (15:00 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Mon, 25 May 2020 20:20:36 +0000 (16:20 -0400)
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I450270710e67d08873f9bd40440417879f5f21c7

lftools/cli/infofile.py

index 62309c7..6b7c917 100644 (file)
@@ -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")