diff options
| author | Todd Willey <todd@ansolabs.com> | 2010-12-21 02:21:01 -0500 |
|---|---|---|
| committer | Todd Willey <todd@ansolabs.com> | 2010-12-21 02:21:01 -0500 |
| commit | 8c8b289f2626b1d9bad76bc5d4819904ace5800d (patch) | |
| tree | c4705eb5ce0a130af5550038d9dfcd53ba752d1c /nova/api | |
| parent | c364724a0dc7a658058fcb167af66ee7eb5bcd2a (diff) | |
Remove ec2 config chain and move openstack versions to top-level application.
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/__init__.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py index cb825cf41..f3686997f 100644 --- a/nova/api/openstack/__init__.py +++ b/nova/api/openstack/__init__.py @@ -20,7 +20,6 @@ WSGI middleware for OpenStack API controllers. """ -import json import time import logging @@ -41,7 +40,6 @@ from nova.api.openstack import images from nova.api.openstack import ratelimiting from nova.api.openstack import servers from nova.api.openstack import sharedipgroups -from nova.auth import manager FLAGS = flags.FLAGS @@ -193,6 +191,19 @@ class APIRouter(wsgi.Router): super(APIRouter, self).__init__(mapper) +class Versions(wsgi.Application): + @webob.dec.wsgify + def __call__(self, req): + """Respond to a request for all OpenStack API versions.""" + response = { + "versions": [ + dict(status="CURRENT", id="v1.0")]} + metadata = { + "application/xml": { + "attributes": dict(version=["status", "id"])}} + return wsgi.Serializer(req.environ, metadata).to_content_type(response) + + def limited(items, req): """Return a slice of items according to requested offset and limit. @@ -223,3 +234,6 @@ def ratelimit_factory(global_conf, **local_conf): def router_factory(global_cof, **local_conf): return APIRouter() + +def versions_factory(global_conf, **local_conf): + return Versions() |
