- log.info("Deleting stack '%s', uuid:%s", self.name, self.uuid)
- heat = self.heat_client
- template = heat.stacks.get(self.uuid)
- start_time = time.time()
- template.delete()
-
- for status in iter(self.status, u'DELETE_COMPLETE'):
- log.debug("stack state %s", status)
- if status == u'DELETE_FAILED':
- raise RuntimeError(
- heat.stacks.get(self.uuid).stack_status_reason)
-
- time.sleep(2)
-
- end_time = time.time()
- log.info("Deleted stack '%s' in %d secs", self.name,
- end_time - start_time)
- self.uuid = None
-
- def delete(self, block=True, retries=3):
- """deletes a stack in the target cloud using heat (with retry)
- Sometimes delete fail with "InternalServerError" and the next attempt
- succeeds. So it is worthwhile to test a couple of times.
- """
+ def delete(self, wait=True):
+ """Deletes a stack in the target cloud"""