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 The best score is the highest score, so this was a 'thinko'. However this bug manifests itself only if there is more than 2 hosts in the setup. Change-Id: I0c265aa60611793b1cd4738ec057e9e7d02747a1 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1093366 Signed-off-by: Jiri Moskovcak <[email protected]> --- 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/22/29922/1 diff --git a/ovirt_hosted_engine_ha/agent/state_machine.py b/ovirt_hosted_engine_ha/agent/state_machine.py index 166c8f2..6bcc224 100644 --- a/ovirt_hosted_engine_ha/agent/state_machine.py +++ b/ovirt_hosted_engine_ha/agent/state_machine.py @@ -111,12 +111,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']) # Prepare changes to the data structure -- To view, visit http://gerrit.ovirt.org/29922 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: ovirt-hosted-engine-ha-1.1 Gerrit-Owner: Jiří Moskovčák <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
