Add wait for resource cleanup if there is no parent

When using cleanup_resource in base_client it now waits
for actual cleanup of the resource if there is no parent
resource. This is to prevent cleanup of resources that
are still in use by the resource that is being deleted.

Change-Id: Idcad34a085d6f346ef225386bb3cdcd450cd4db7
Story: 2004835
Task: 29029
This commit is contained in:
Tom Stappaerts 2019-01-23 09:38:27 +01:00 committed by Michael Johnson
parent 04dc5cb4a0
commit e05ba7e4f0
1 changed files with 7 additions and 0 deletions

View File

@ -414,6 +414,13 @@ class BaseLBaaSClient(rest_client.RestClient):
const.ACTIVE,
self.build_interval,
self.timeout)
else:
LOG.info("Waiting for %s %s to be DELETED...",
wait_client.root_tag, wait_id)
waiters.wait_for_deleted_status_or_not_found(
wait_func, wait_id, const.PROVISIONING_STATUS,
CONF.load_balancer.check_interval,
CONF.load_balancer.check_timeout)
LOG.info("Cleanup complete for %s %s...", self.root_tag, obj_id)
return return_status