]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: Fixing python statement in ceph_objectstore_tool.py
authorErwan Velu <erwan@redhat.com>
Wed, 23 Mar 2016 13:07:36 +0000 (14:07 +0100)
committerErwan Velu <erwan@redhat.com>
Tue, 5 Apr 2016 07:36:25 +0000 (09:36 +0200)
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 <erwan@redhat.com>
src/test/ceph_objectstore_tool.py

index 454bf845f281a67bd3668ab7d209b5a66305302f..81af00ac493b5bb1d3daf5740e245152edf0f0dc 100755 (executable)
@@ -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"