From fc94879498aa6f39b08c2741365c224c018403c0 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 17 Apr 2014 11:08:36 -0500 Subject: [PATCH] safe_while: Don't sleep() on the first attempt This was causing unnecessary delays in several places Signed-off-by: Zack Cerza --- teuthology/contextutil.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teuthology/contextutil.py b/teuthology/contextutil.py index 55413ffa9ca88..99b694ca68367 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: -- 2.39.5