Use status_check boolean return to control retries loop
Change-Id: Ia8042e465084c8caae8479cf96823ab06b9abda3
This commit is contained in:
parent
09a742cadb
commit
e9e6b3b1c6
@ -371,19 +371,16 @@ class WorkerThread(threading.Thread):
|
||||
else:
|
||||
max_wait_time = CONF.resource_creation_timeout_min
|
||||
|
||||
start_time = time.time()
|
||||
waiting_time = 0
|
||||
status_check = HEATIntermediateStatusChecker(stack, operation)
|
||||
status = ''
|
||||
while status != HEATIntermediateStatusChecker.STATUS_COMPLETE \
|
||||
and status != HEATIntermediateStatusChecker.STATUS_FAIL \
|
||||
and (waiting_time <= max_wait_time):
|
||||
status = True
|
||||
while status and (waiting_time <= max_wait_time):
|
||||
time.sleep(poll_interval)
|
||||
waiting_time = time.time() - start_time
|
||||
waiting_time += poll_interval
|
||||
|
||||
LOG.debug('Thread %s: Waiting for %s to finish;'
|
||||
' time elapsed: %s', self.threadID,
|
||||
stack.stack_name, int(waiting_time))
|
||||
stack.stack_name, waiting_time)
|
||||
|
||||
stack = self._heat_client.get_stack(stack.id)
|
||||
status = status_check(stack)
|
||||
|
Loading…
x
Reference in New Issue
Block a user