'Waits for a resource to be deleted
This method will loop over is_resource_deleted until either
is_resource_deleted returns True or the build timeout is reached. This
depends on is_resource_deleted being implemented
:param str id: The id of the resource to check
:raises TimeoutException: If the build_timeout has elapsed and the
resource still hasn\'t been deleted'

def wait_for_resource_deletion(self, id):

    start_time = int(time.time())
    while True:
        if self.is_resource_deleted(id):
            return
        if ((int(time.time()) - start_time) >= self.build_timeout):
            message = ('Failed    to    delete    %(resource_type)s    %(id)s    within    the    required    time    (%(timeout)s    s).' % {'resource_type': self.resource_type, 'id': id, 'timeout': self.build_timeout})
            caller = test_utils.find_test_caller()
            if caller:
                message = ('(%s)    %s' % (caller, message))
            raise exceptions.TimeoutException(message)
        time.sleep(self.build_interval)
