def wait_exception(lfunction):
"""Returns with the exception or raises one."""
start_time = time.time()
while True:
try:
lfunction()
except BaseException as exc:
LOG.info('Exception in %d second',
time.time() - start_time)
return exc
dtime = time.time() - start_time
if dtime > CONF.boto.build_timeout:
raise TestCase.failureException("Wait timeout exceeded! (%ds)" %
dtime)
time.sleep(CONF.boto.build_interval)
# TODO(afazekas): consider strategy design pattern..
评论列表
文章目录