From: Zack Cerza Date: Thu, 17 Apr 2014 16:08:36 +0000 (-0500) Subject: safe_while: Don't sleep() on the first attempt X-Git-Tag: 1.1.0~1534 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc94879498aa6f39b08c2741365c224c018403c0;p=teuthology.git safe_while: Don't sleep() on the first attempt This was causing unnecessary delays in several places Signed-off-by: Zack Cerza --- diff --git a/teuthology/contextutil.py b/teuthology/contextutil.py index 55413ffa9..99b694ca6 100644 --- a/teuthology/contextutil.py +++ b/teuthology/contextutil.py @@ -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: