Code review comment for lp:~rconradharris/glance/lp615675

Revision history for this message
Jay Pipes (jaypipes) wrote :

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.
    """

    def __init__(self):
        mapper = routes.Mapper()
        mapper.resource("image", "images", controller=images.Controller(),
            collection={'detail': 'GET'})
        super(APIRouter, self).__init__(mapper)

Cheers!
jay

« Back to merge proposal