summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-07-27 15:29:15 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-07-27 15:29:15 -0400
commit2ac60cd773bb25e19b50c082e0860b1c495d1527 (patch)
tree2b71386fde2fc63e35016e058ccde707281435bb /nova/api
parentc20a4845afc47d124017de698657c1713dc11e7f (diff)
update everything to use global VERSIONS
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/versions.py49
1 files changed, 17 insertions, 32 deletions
diff --git a/nova/api/openstack/versions.py b/nova/api/openstack/versions.py
index b38c48939..32ee64339 100644
--- a/nova/api/openstack/versions.py
+++ b/nova/api/openstack/versions.py
@@ -143,20 +143,14 @@ class Versions(wsgi.Resource):
return self._versions_multi_choice(request)
def _versions_list(self, request):
- version_objs = [
- {
- "id": "v1.1",
- "status": "CURRENT",
- #TODO(wwolf) get correct value for these
- "updated": "2011-07-18T11:30:00Z",
- },
- {
- "id": "v1.0",
- "status": "DEPRECATED",
- #TODO(wwolf) get correct value for these
- "updated": "2010-10-09T11:30:00Z",
- },
- ]
+ version_objs = []
+ for version in VERSIONS:
+ version = VERSIONS[version]['version']
+ version_objs.append({
+ "id": version['id'],
+ "status": version['status'],
+ "updated": version['updated'],
+ })
builder = nova.api.openstack.views.versions.get_view_builder(request)
versions = [builder.build(version) for version in version_objs]
@@ -164,28 +158,19 @@ class Versions(wsgi.Resource):
def _versions_multi_choice(self, request):
#TODO
- version_objs = [
- {
- "id": "v1.1",
- "status": "CURRENT",
+ version_objs = []
+ for version in VERSIONS:
+ version = VERSIONS[version]['version']
+ version_objs.append({
+ "id": version['id'],
+ "status": version['status'],
"links": [
{
- "rel": "self",
+ "rel": "self"
}
],
- "media-types": VERSIONS['v1.1']['version']['media-types'],
- },
- {
- "id": "v1.0",
- "status": "DEPRECATED",
- "links": [
- {
- "rel": "self",
- }
- ],
- "media-types": VERSIONS['v1.0']['version']['media-types'],
- },
- ]
+ "media-types": version['media-types']
+ })
builder = nova.api.openstack.views.versions.get_view_builder(request)
choices = [