]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
safe_while: Don't sleep() on the first attempt
authorZack Cerza <zack@cerza.org>
Thu, 17 Apr 2014 16:08:36 +0000 (11:08 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 17 Apr 2014 16:08:36 +0000 (11:08 -0500)
This was causing unnecessary delays in several places

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/contextutil.py

index 55413ffa9ca88f1e79b6a0d2453224b31dea6016..99b694ca68367029a77f77bfa94c25164fd91403 100644 (file)
@@ -119,6 +119,8 @@ class safe_while(object):
 
     def __call__(self):
         self.counter += 1
+        if self.counter == 1:
+            return True
         if self.counter > self.tries:
             error_msg = self._make_error_msg()
             if self._raise: