make print python3 compatible

The print '' in python2 was supported. But in python3,
print '' was error. In python3, recommend using print()
instead. This patch will fix it.

Change-Id: I226461b0400023dc44238d9e5ee1ae2f2430de9e
Closes-Bug: #1595773
This commit is contained in:
zhengyao1 2016-06-24 17:34:26 +08:00 committed by YaoZheng
parent c0217a4845
commit 4a9f7378ec

View File

@ -294,7 +294,7 @@ def run_scenario(scenario):
}
for round_index, commands in enumerate(scenario['rounds']):
print "Round %d" % (round_index + 1)
print("Round %d" % (round_index + 1))
for command in commands:
key = command.pop(0)
@ -307,17 +307,16 @@ def run_scenario(scenario):
rebalance_number = 1
parts_moved, old_balance, removed_devs = rb.rebalance(seed=seed)
rb.pretend_min_part_hours_passed()
print "\tRebalance 1: moved %d parts, balance is %.6f, \
%d removed devs" % (
parts_moved, old_balance, removed_devs)
print("\tRebalance 1: moved %d parts, balance is %.6f, %d removed "
"devs" % (parts_moved, old_balance, removed_devs))
while True:
rebalance_number += 1
parts_moved, new_balance, removed_devs = rb.rebalance(seed=seed)
rb.pretend_min_part_hours_passed()
print "\tRebalance %d: moved %d parts, balance is %.6f, \
%d removed devs" % (
rebalance_number, parts_moved, new_balance, removed_devs)
print("\tRebalance %d: moved %d parts, balance is %.6f, "
"%d removed devs" % (rebalance_number, parts_moved,
new_balance, removed_devs))
if parts_moved == 0 and removed_devs == 0:
break
if abs(new_balance - old_balance) < 1 and not (