def wrap_check_policy(func):
    'Check policy corresponding to the wrapped methods prior to execution\n\n    This decorator requires the first 3 args of the wrapped function\n    to be (self, context, volume)\n    '

    @functools.wraps(func)
    def wrapped(self, context, target_obj, *args, **kwargs):
        check_policy(context, func.__name__, target_obj)
        return func(self, context, target_obj, *args, **kwargs)
    return wrapped
Check policy corresponding to the wrapped methods prior to execution

This decorator requires the first 3 args of the wrapped function
to be (self, context, volume)
def wrap_check_policy(func):
    'Check policy corresponding to the wrapped methods prior to execution\n\n    This decorator requires the first 3 args of the wrapped function\n    to be (self, context, volume)\n    '

    @functools.wraps(func)
    def wrapped(self, context, target_obj, *args, **kwargs):
        check_policy(context, func.__name__, target_obj)
        return func(self, context, target_obj, *args, **kwargs)
    return wrapped