summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/takeover
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2011-07-22 20:24:28 +1000
committerMartin Schwenke <martin@meltin.net>2011-07-29 14:32:07 +1000
commit85c0b10a38ed2152ff1401d791e09cf40c97ef46 (patch)
treeea42ba9445ad318304bcb3f3eb1af6dcc7b55601 /ctdb/tests/takeover
parentd2ec92ba71b99a6a2e84aeb5a0784f134f6a3b0b (diff)
downloadsamba-85c0b10a38ed2152ff1401d791e09cf40c97ef46.tar.gz
samba-85c0b10a38ed2152ff1401d791e09cf40c97ef46.tar.xz
samba-85c0b10a38ed2152ff1401d791e09cf40c97ef46.zip
IP allocation simulation - tighten up termination condition for -x.
When there are IP groups, do not terminate when the overall cluster goes out of balance. Also make explicit that grat_ip_moves is an integer not a boolean, so only terminate if it is greater than 0. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 0899f14b1483682d73d1ee2d2419db54ffeadc4b)
Diffstat (limited to 'ctdb/tests/takeover')
-rwxr-xr-xctdb/tests/takeover/ctdb_takeover.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ctdb/tests/takeover/ctdb_takeover.py b/ctdb/tests/takeover/ctdb_takeover.py
index 8f9cf6de714..e6dc19c7707 100755
--- a/ctdb/tests/takeover/ctdb_takeover.py
+++ b/ctdb/tests/takeover/ctdb_takeover.py
@@ -799,6 +799,7 @@ class Cluster(object):
self.prev = None
self.prev = copy.deepcopy(self)
- return grat_ip_moves or \
- imbalance > options.hard_limit or \
+ # True is bad!
+ return (grat_ip_moves > 0) or \
+ (not self.have_ip_groups() and imbalance > options.hard_limit) or \
(self.have_ip_groups() and (max(imbalance_groups) > options.hard_limit))