[openstack-dev] [nova] - filter out fields in keypair object.

Dmitry Bogun dbogun at mirantis.com
Thu Dec 11 15:09:12 UTC 2014


Hi.

Why we filter out some fields from keeper object in "create" and "list" operations?


in module nova.api.openstack.compute.plugins.v3.keypairs

class KeypairController(wsgi.Controller):
# ...

    def _filter_keypair(self, keypair, **attrs):
        clean = {
            'name': keypair.name,
            'public_key': keypair.public_key,
            'fingerprint': keypair.fingerprint,
            }
        for attr in attrs:
            clean[attr] = keypair[attr]
        return clean

we have method _filter_kaypar. This method used to create response in "create" and "index" methods. Why we need it?

PS I need user_id field in "list/index" request in horizon. The only way to got it now - use "get/show" method for each returned object.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20141211/06cf16f7/attachment.html>


More information about the OpenStack-dev mailing list