OpenStack Image Registry and Delivery Service (Glance)

Image cache middleware order should not matter in paste pipeline

Reported by Brian Waldon on 2012-03-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Low
Brian Waldon

Bug Description

If I use the following paste pipeline:

[pipeline:glance-api]
pipeline = versionnegotiation authtoken auth-context cachemanage cache apiv1app

...the glance-api daemon throws this traceback:

Traceback (most recent call last):
  File "bin/glance-api", line 48, in <module>
    app = config.load_paste_app(conf)
  File "/opt/stack/glance/glance/common/config.py", line 174, in load_paste_app
    app = wsgi.paste_deploy_app(conf_file, app_name, conf)
  File "/opt/stack/glance/glance/common/wsgi.py", line 647, in paste_deploy_app
    return deploy.loadapp("config:%s" % paste_config_file, name=app_name)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 207, in invoke
    app = filter(app)
  File "/opt/stack/glance/glance/common/wsgi.py", line 598, in filter
    return factory(app, self.conf, **local_conf)
  File "/opt/stack/glance/glance/api/middleware/cache_manage.py", line 32, in __init__
    map = app.map
AttributeError: 'CacheFilter' object has no attribute 'map'

If I reverse the order of cache and cachemanage, the api comes up correctly. The order of the middleware should not matter.

Brian Waldon (bcwaldon) on 2012-03-14
Changed in glance:
importance: Undecided → Low
Brian Waldon (bcwaldon) wrote :

It appears that the cachemanage middleware depends on the 'map' attribute that the apiv1app sets up in the pipeline. We need to break that dependency.

Changed in glance:
status: New → In Progress
assignee: nobody → Brian Waldon (bcwaldon)
Jay Pipes (jaypipes) on 2012-03-15
Changed in glance:
milestone: none → essex-rc1

Reviewed: https://review.openstack.org/5416
Committed: http://github.com/openstack/glance/commit/d759821b287398f1422af862abaf133ed23e0736
Submitter: Jenkins
Branch: master

commit d759821b287398f1422af862abaf133ed23e0736
Author: Brian Waldon <email address hidden>
Date: Thu Mar 15 14:14:14 2012 -0700

    Remove dependency on apiv1app from cachemanage

    * Cache management middleware shouldn't depend on being deployed around
      the glance api v1 app. This breaks that dependency in favor of an
      isolated mapper in the cache management middleware.
    * Fixes bug 954596

    Change-Id: I3f4f56eac285163d1ce9c7dc1cef5178b16eefb6

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-03-21
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in glance:
milestone: essex-rc1 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers