def require_volume_exists(f):
 def wrapper(context, volume_id, *args, **kwargs):
  db.volume_get(context, volume_id)
  return f(context, volume_id, *args, **kwargs)
 wrapper.__name__ = f.__name__
 return wrapper

def require_volume_exists ( f ) : def wrapper ( context , volume_id , * args , ** kwargs ) : db . volume_get ( context , volume_id ) return f ( context , volume_id , * args , ** kwargs ) wrapper . __name__ = f . __name__ return wrapper
decorator to require the specified volume to exist .