Looks good! We can refactor the common stuff into openstack-common after Austin, of course.
The only suggestion I have is to combine the glance.parallax.api.API and glance.parallax.api.APIRouter class into a single class. wsgi.Router *is* middleware (since its constructor sets routes.RoutesMiddleware as the application to return, and its __call__ method returns that application, so unless I'm mistaken, the following code should work fine:
class API(wsgi.Router):
"""
Routes requests on the Parallax to the appropriate controller
and method.
"""
Looks good! We can refactor the common stuff into openstack-common after Austin, of course.
The only suggestion I have is to combine the glance. parallax. api.API and glance. parallax. api.APIRouter class into a single class. wsgi.Router *is* middleware (since its constructor sets routes. RoutesMiddlewar e as the application to return, and its __call__ method returns that application, so unless I'm mistaken, the following code should work fine:
class API(wsgi.Router):
"""
Routes requests on the Parallax to the appropriate controller
and method.
"""
def __init__(self):
mapper. resource( "image" , "images", controller= images. Controller( ),
collection ={'detail' : 'GET'})
super( APIRouter, self)._ _init__ (mapper)
mapper = routes.Mapper()
Cheers!
jay