Merge "make print python3 compatible"
This commit is contained in:
commit
fcba866138
@ -294,7 +294,7 @@ def run_scenario(scenario):
|
|||||||
}
|
}
|
||||||
|
|
||||||
for round_index, commands in enumerate(scenario['rounds']):
|
for round_index, commands in enumerate(scenario['rounds']):
|
||||||
print "Round %d" % (round_index + 1)
|
print("Round %d" % (round_index + 1))
|
||||||
|
|
||||||
for command in commands:
|
for command in commands:
|
||||||
key = command.pop(0)
|
key = command.pop(0)
|
||||||
@ -307,17 +307,16 @@ def run_scenario(scenario):
|
|||||||
rebalance_number = 1
|
rebalance_number = 1
|
||||||
parts_moved, old_balance, removed_devs = rb.rebalance(seed=seed)
|
parts_moved, old_balance, removed_devs = rb.rebalance(seed=seed)
|
||||||
rb.pretend_min_part_hours_passed()
|
rb.pretend_min_part_hours_passed()
|
||||||
print "\tRebalance 1: moved %d parts, balance is %.6f, \
|
print("\tRebalance 1: moved %d parts, balance is %.6f, %d removed "
|
||||||
%d removed devs" % (
|
"devs" % (parts_moved, old_balance, removed_devs))
|
||||||
parts_moved, old_balance, removed_devs)
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
rebalance_number += 1
|
rebalance_number += 1
|
||||||
parts_moved, new_balance, removed_devs = rb.rebalance(seed=seed)
|
parts_moved, new_balance, removed_devs = rb.rebalance(seed=seed)
|
||||||
rb.pretend_min_part_hours_passed()
|
rb.pretend_min_part_hours_passed()
|
||||||
print "\tRebalance %d: moved %d parts, balance is %.6f, \
|
print("\tRebalance %d: moved %d parts, balance is %.6f, "
|
||||||
%d removed devs" % (
|
"%d removed devs" % (rebalance_number, parts_moved,
|
||||||
rebalance_number, parts_moved, new_balance, removed_devs)
|
new_balance, removed_devs))
|
||||||
if parts_moved == 0 and removed_devs == 0:
|
if parts_moved == 0 and removed_devs == 0:
|
||||||
break
|
break
|
||||||
if abs(new_balance - old_balance) < 1 and not (
|
if abs(new_balance - old_balance) < 1 and not (
|
||||||
|
Loading…
Reference in New Issue
Block a user