From: Kevin Benton Date: Tue, 15 Sep 2015 17:04:09 +0000 (-0700) Subject: Clarify and add a TODO in the controller X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1a87e36c61444531874a4e6b3018c37ca4a0d566;p=openstack-build%2Fneutron-build.git Clarify and add a TODO in the controller This clarifies and adds a TODO regarding the filters and fields API parameters. Change-Id: I01cfd45b99dcfca4e320900caebdc68f6562ddd8 --- diff --git a/neutron/pecan_wsgi/controllers/root.py b/neutron/pecan_wsgi/controllers/root.py index 396778bac..41a249932 100644 --- a/neutron/pecan_wsgi/controllers/root.py +++ b/neutron/pecan_wsgi/controllers/root.py @@ -128,10 +128,12 @@ class CollectionsController(object): def get(self, *args, **kwargs): # list request - # TODO(kevinbenton): allow fields after policy enforced fields present + # TODO(kevinbenton): use user-provided fields in call to plugin + # after making sure policy enforced fields remain kwargs.pop('fields', None) _listify = lambda x: x if isinstance(x, list) else [x] filters = {k: _listify(v) for k, v in kwargs.items()} + # TODO(kevinbenton): convert these using api_common.get_filters lister = getattr(request.plugin, 'get_%s' % self.collection) return {self.collection: lister(request.context, filters=filters)}