From 4a9f7378ec4d73c8bf16748e24bec45aa503b08e Mon Sep 17 00:00:00 2001 From: zhengyao1 Date: Fri, 24 Jun 2016 17:34:26 +0800 Subject: [PATCH] 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 --- swift/cli/ring_builder_analyzer.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/swift/cli/ring_builder_analyzer.py b/swift/cli/ring_builder_analyzer.py index 599af0e4d7..5c1955414c 100644 --- a/swift/cli/ring_builder_analyzer.py +++ b/swift/cli/ring_builder_analyzer.py @@ -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 (