Jiří Moskovčák has uploaded a new change for review.

Change subject: use max not min when computing the best score
......................................................................

use max not min when computing the best score

Change-Id: I0c265aa60611793b1cd4738ec057e9e7d02747a1
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1093366
Signed-off-by: Jiri Moskovcak <jmosk...@redhat.com>
---
M ovirt_hosted_engine_ha/agent/state_machine.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-ha 
refs/changes/80/29580/1

diff --git a/ovirt_hosted_engine_ha/agent/state_machine.py 
b/ovirt_hosted_engine_ha/agent/state_machine.py
index 51c407a..94fd3ab 100644
--- a/ovirt_hosted_engine_ha/agent/state_machine.py
+++ b/ovirt_hosted_engine_ha/agent/state_machine.py
@@ -121,12 +121,12 @@
         if alive_hosts:
             # Pre-compute the best remote engine (skip old metadata
             # for local host)
-            best_engine = min(alive_hosts,
+            best_engine = max(alive_hosts,
                               key=lambda st:
                               engine_status_score(st['engine-status']))
 
             # Pre-compute best remote score (skip old metadata for local host)
-            best_score = min(alive_hosts,
+            best_score = max(alive_hosts,
                              key=lambda st: st['score'])
 
         # Compare the best engine remote values with the local state


-- 
To view, visit http://gerrit.ovirt.org/29580
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c265aa60611793b1cd4738ec057e9e7d02747a1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-ha
Gerrit-Branch: master
Gerrit-Owner: Jiří Moskovčák <jmosk...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to