def retry(fun):
    @functools.wraps(fun)
    def _wrapper(*args, **kwargs):
        max_retries = kwargs.pop('max_retries', 2)
        expected = kwargs.pop('expected_ret_code', 0)

        actual_ret = None
        for tries in range(max_retries):
            try:
                actual_ret = fun(*args, **kwargs)
                if expected == actual_ret:
                    return actual_ret
            except Exception:
                if tries + 1 >= max_retries:
                    raise

            time.sleep(1)
        return actual_ret
    return _wrapper
Establish that the _assoc method returns an changed status
dataset/ETHPy150Open openstack/solum/solum/worker/app_handlers/utils.py/retry--crossover with--dataset/ETHPy150Open ansible/tower-cli/tests/test_models_base.py/ResourceTests.test_disassoc_already_present