glance fails to start in Swift multi_tenant mode

Bug #1037745 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Dan Prince

Bug Description

Using the most recent Glance Folsom code.... If I try to startup Glance API with swift_store_multi_tenant = True if fails with the following error in api.log:

/python2.7/site-packages/paste/urlmap.py", line 25, in urlmap_factory
2012-08-16 15:36:07 TRACE glance app = loader.get_app(app_name, global_conf=global_conf)
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/.venv/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2012-08-16 15:36:07 TRACE glance name=name, global_conf=global_conf).create()
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/.venv/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
2012-08-16 15:36:07 TRACE glance return self.object_type.invoke(self)
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/.venv/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
2012-08-16 15:36:07 TRACE glance return fix_call(context.object, context.global_conf, **context.local_conf)
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/.venv/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call
2012-08-16 15:36:07 TRACE glance val = callable(*args, **kw)
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/glance/common/wsgi.py", line 396, in factory
2012-08-16 15:36:07 TRACE glance return cls(routes.Mapper())
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/glance/api/v2/router.py", line 64, in __init__
2012-08-16 15:36:07 TRACE glance image_data_resource = image_data.create_resource()
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/glance/api/v2/image_data.py", line 104, in create_resource
2012-08-16 15:36:07 TRACE glance controller = ImageDataController()
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/glance/api/v2/image_data.py", line 33, in __init__
2012-08-16 15:36:07 TRACE glance self.store_api.create_stores()
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/glance/store/__init__.py", line 167, in create_stores
2012-08-16 15:36:07 TRACE glance store_instance = store_cls()
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/glance/store/base.py", line 41, in __init__
2012-08-16 15:36:07 TRACE glance self.configure_add()
2012-08-16 15:36:07 TRACE glance File "/home/dprince/projects/glance/glance/store/swift.py", line 236, in configure_add
2012-08-16 15:36:07 TRACE glance if context is None:
2012-08-16 15:36:07 TRACE glance NameError: global name 'context' is not defined
2012-08-16 15:36:07 TRACE glance

Dan Prince (dan-prince)
Changed in glance:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → High
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11497

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/11497
Committed: http://github.com/openstack/glance/commit/881e107e809e9ada5a734b9e0777375beb7233fe
Submitter: Jenkins
Branch: master

commit 881e107e809e9ada5a734b9e0777375beb7233fe
Author: Dan Prince <email address hidden>
Date: Thu Aug 16 15:40:59 2012 -0400

    multi_tenant: Fix 'context' is not defined error

    Corrects the variable name 'context' to be 'self.context' in the
    configure_add method of the swift store. We changed/moved this code
    late during the review process of the multi_tenant swift feature
    and obviously didn't add a functional/unit test on the new location
    which now causes this exception to get thrown:

        NameError: global name 'context' is not defined

    This patch also includes a new glance function test to startup
    the Glance API in multi-tenant mode. The test_multi_tenant_mode
    test will fail with the previous swift store implementation.

    Fixes LP Bug #1037745

    Change-Id: I7681ad704b169c5fe815adf2fe704e5d18ea8e83

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.