~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/api/ec2/admin.py

  • Committer: Tarmac
  • Author(s): Rick Harris
  • Date: 2011-09-22 16:42:20 UTC
  • mfrom: (1590.1.11 flavor_min_filter)
  • Revision ID: tarmac-20110922164220-ndscikwberuj3c7f
This patch adds flavor filtering, specifically the ability to flavor on minRam, minDisk, or both, per the 1.1 OSAPI spec.

In addition, this patch refactors instance_type_get_all to return a *list* of instance_types instead of a *dict*. This makes it more consistent with the rest of the DB API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
 
127
127
    def describe_instance_types(self, context, **_kwargs):
128
128
        """Returns all active instance types data (vcpus, memory, etc.)"""
129
 
        return {'instanceTypeSet': [instance_dict(v) for v in
130
 
                                   db.instance_type_get_all(context).values()]}
 
129
        inst_types = db.instance_type_get_all(context)
 
130
        inst_type_dicts = [instance_dict(i) for i in inst_types]
 
131
        return {'instanceTypeSet': inst_type_dicts}
131
132
 
132
133
    def describe_user(self, _context, name, **_kwargs):
133
134
        """Returns user data, including access and secret keys."""