def index(self, req, type_id): context = req.environ['cinder.context'] context.authorize(policy.TYPE_ACCESS_POLICY) # Not found exception will be handled at the wsgi level vol_type = volume_types.get_volume_type( context, type_id, expected_fields=['projects']) if vol_type['is_public']: expl = _("Access list not available for public volume types.") raise exception.VolumeTypeAccessNotFound(message=expl) return _marshall_volume_type_access(vol_type)
def stub_remove_volume_type_access(context, type_id, project_id): raise exception.VolumeTypeAccessNotFound(volume_type_id=type_id, project_id=project_id)