'Repeatedly call a function with given arguments until AssertionErrors
stop or configured number of repetitions are reached.
Some backends are eventually consistent, which means results of
listing volumes may not reflect actions immediately. So for
read-only operations that rely on listing we want to be able to
retry.
Retry policy can be changed by overriding the ``repeat_retries``
method.
@param f: Function to call.
@param args: Arguments for ``f``.
@param kwargs: Keyword arguments for ``f``.'

def repeat_until_consistent(self, f, *args, **kwargs):

    for step in self.repeat_retries():
        try:
            return f(*args, **kwargs)
        except AssertionError as e:
            time.sleep(step)
    raise e
