summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorMichael Gundlach <michael.gundlach@rackspace.com>2010-09-02 13:04:05 -0400
committerMichael Gundlach <michael.gundlach@rackspace.com>2010-09-02 13:04:05 -0400
commit8169a2a26c5b646a4d6c63c77f15f6aaa6898cb4 (patch)
tree8c161f17495a837a027e65b2b327ee1a8307f6a7 /nova/api
parentb965dde9e95e16a9a207697d5729bd146c2dfd23 (diff)
downloadnova-8169a2a26c5b646a4d6c63c77f15f6aaa6898cb4.tar.gz
nova-8169a2a26c5b646a4d6c63c77f15f6aaa6898cb4.tar.xz
nova-8169a2a26c5b646a4d6c63c77f15f6aaa6898cb4.zip
Small typos, plus rework api_unittest to use WSGI instead of Tornado
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/__init__.py2
-rw-r--r--nova/api/ec2/__init__.py10
2 files changed, 7 insertions, 5 deletions
diff --git a/nova/api/__init__.py b/nova/api/__init__.py
index 0166b7fc1..786b246ec 100644
--- a/nova/api/__init__.py
+++ b/nova/api/__init__.py
@@ -37,5 +37,5 @@ class API(wsgi.Router):
# be dropped; and I'm leaving off CloudPipeRequestHandler until
# I hear that we need it.
mapper.connect("/v1.0/{path_info:.*}", controller=rackspace.API())
- mapper.connect("/ec2/{path_info:.*}", controller=ec2.API())
+ mapper.connect("/services/{path_info:.*}", controller=ec2.API())
super(API, self).__init__(mapper)
diff --git a/nova/api/ec2/__init__.py b/nova/api/ec2/__init__.py
index 3335338e0..a94bcb863 100644
--- a/nova/api/ec2/__init__.py
+++ b/nova/api/ec2/__init__.py
@@ -44,6 +44,7 @@ class API(wsgi.Middleware):
def __init__(self):
self.application = Authenticate(Router(Authorizer(Executor())))
+
class Authenticate(wsgi.Middleware):
"""Authenticate an EC2 request and add 'ec2.context' to WSGI environ."""
@@ -81,11 +82,12 @@ class Authenticate(wsgi.Middleware):
return self.application
-class Router(wsgi.Application):
+class Router(wsgi.Middleware):
"""
Add 'ec2.controller', 'ec2.action', and 'ec2.action_args' to WSGI environ.
"""
- def __init__(self):
+ def __init__(self, application):
+ super(Router, self).__init__(application)
self.map = routes.Mapper()
self.map.connect("/{controller_name}/")
self.controllers = dict(Cloud=cloud.CloudController(),
@@ -122,14 +124,14 @@ class Router(wsgi.Application):
return self.application
-class Authorization(wsgi.Middleware):
+class Authorizer(wsgi.Middleware):
"""
Return a 401 if ec2.controller and ec2.action in WSGI environ may not be
executed in ec2.context.
"""
def __init__(self, application):
- super(Authorization, self).__init__(application)
+ super(Authorizer, self).__init__(application)
self.action_roles = {
'CloudController': {
'DescribeAvailabilityzones': ['all'],