'Waits for a resource to be deleted.'

def wait_for_resource_deletion(self, resource_type, id):

    start_time = int(time.time())
    while True:
        if self.is_resource_deleted(resource_type, id):
            return
        if ((int(time.time()) - start_time) >= self.build_timeout):
            raise exceptions.TimeoutException
        time.sleep(self.build_interval)
