Clean up non-spec output in flavor extensions

Adds option to cache flavors in the request object like instances.
Modifies the flavorextradata extension to use the cache and optimizes
tests. Adds flavor_disabled extension to control the extra data and
includes tests. Fixes api samples to show the new extension.

Fixes bug 1043585

Change-Id: Ie89df24a2891e3869d3fb604e07c79e8c913f290
This commit is contained in:
Vishvananda Ishaya
2012-08-29 17:50:58 -07:00
parent 4a6193b5d2
commit f9fa7a68a3
17 changed files with 294 additions and 101 deletions

View File

@@ -49,12 +49,6 @@ class ViewBuilder(common.ViewBuilder):
},
}
# NOTE(sirp): disabled attribute is namespaced for now for
# compatability with the OpenStack API. This should ultimately be made
# a first class attribute.
flavor_dict["flavor"]["OS-FLV-DISABLED:disabled"] =\
flavor.get("disabled", "")
return flavor_dict
def index(self, request, flavors):