From: Erwan Velu Date: Wed, 23 Mar 2016 13:07:36 +0000 (+0100) Subject: tests: Fixing python statement in ceph_objectstore_tool.py X-Git-Tag: v10.1.1~3^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4af1aa6a9da9a58ee937b45b017074e3818373e4;p=ceph.git tests: Fixing python statement in ceph_objectstore_tool.py As reported by Kefu, "if ++try == 150" doesn't do what we are expecting. This is C-style coding which is invalid in Python. So this patch is splitting the increment and the test. Signed-off-by: Erwan Velu --- diff --git a/src/test/ceph_objectstore_tool.py b/src/test/ceph_objectstore_tool.py index 454bf845f28..81af00ac493 100755 --- a/src/test/ceph_objectstore_tool.py +++ b/src/test/ceph_objectstore_tool.py @@ -44,7 +44,8 @@ def wait_for_health(): print "Wait for health_ok...", tries = 0 while call("./ceph health 2> /dev/null | grep -v 'HEALTH_OK\|HEALTH_WARN' > /dev/null", shell=True) == 0: - if ++tries == 150: + tries += 1 + if tries == 150: raise Exception("Time exceeded to go to health") time.sleep(1) print "DONE"