Comment 5 for bug 1206762

Revision history for this message
ruandongdong (hzrandd) wrote :

Get all flavors by the interface 'detail',it is inefficient . because it return datas have no extra_specs information ,why not get them by the interface 'show', as we all konw: In the file of nova/api/openstack/compute/views/flavors.py
def show(self, request, flavor):
    flavor_dict = {
            "flavor": {
                "id": flavor["flavorid"],
                "name": flavor["name"],
                "ram": flavor["memory_mb"],
                "disk": flavor["root_gb"],
                "vcpus": flavor.get("vcpus") or "",
                "links": self._get_links(request,
                                         flavor["flavorid"],
                                         self._collection_name),
            },
        }
   if flavor.get('extra_specs'):
        flavor_dict['flavor']['extra_specs'] = flavor['extra_specs'] # get extra_specs information and return it here.
   return flavor_dict

At the same time,should modfiy in the novaclient.