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>
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"