diff --git a/bonfire/openshift.py b/bonfire/openshift.py index ed4f2519..fb9d9f05 100644 --- a/bonfire/openshift.py +++ b/bonfire/openshift.py @@ -421,7 +421,7 @@ def _check_with_periodic_log(self): self._time_last_logged = time.time() return False - def wait_for_ready(self, timeout): + def wait_for_ready(self, timeout, reraise=False): self._time_last_logged = time.time() self._time_remaining = timeout @@ -439,8 +439,12 @@ def wait_for_ready(self, timeout): return True except (StatusError, ErrorReturnCode) as err: log.error("[%s] hit error waiting for resource to be ready: %s", self.key, str(err)) + if reraise: + raise except (TimeoutException, TimedOutError): log.error("[%s] timed out waiting for resource to be ready", self.key) + if reraise: + raise return False @@ -728,7 +732,7 @@ def _pod_found(): remaining_time = remaining_time - elapsed waiter = ResourceWaiter(namespace, "pod", pod_name) - waiter.wait_for_ready(remaining_time) + waiter.wait_for_ready(remaining_time, reraise=True) return pod_name