Glance lazy loading issue -- still coupled with Swift

Bug #731684 reported by Matt Dietz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Rick Harris

Bug Description

When using glance without swift installed, an exception is thrown:

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/eventlet/wsgi.py", line 347, in handle_one_response
    for data in result:
  File "/root/code/glance/trunk/glance/server.py", line 158, in image_iterator
    options=self.options)
  File "/root/code/glance/trunk/glance/store/__init__.py", line 80, in get_from_backend
    backend_class = get_backend_class(scheme)
  File "/root/code/glance/trunk/glance/store/__init__.py", line 58, in get_backend_class
    from glance.store.swift import SwiftBackend
  File "/root/code/glance/trunk/glance/store/swift.py", line 25, in <module>
    from swift.common.client import Connection, ClientException
ImportError: No module named swift.common.client

Related branches

Changed in glance:
importance: Undecided → High
Revision history for this message
Jay Pipes (jaypipes) wrote :

is this a case of just needing from __future__ import absolute_import at the top of glance.store.__init__.py?

Changed in glance:
status: New → In Progress
assignee: nobody → Rick Harris (rconradharris)
Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
Jay Pipes (jaypipes) wrote :

Still not working. Latest trunk, run_tests.sh -V:

======================================================================
ERROR: Failure: ImportError (No module named swift.common.client)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jpipes/repos/glance/image-format/.glance-venv/lib/python2.6/site-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/jpipes/repos/glance/image-format/.glance-venv/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/jpipes/repos/glance/image-format/.glance-venv/lib/python2.6/site-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/jpipes/repos/glance/image-format/tests/unit/test_swift_store.py", line 28, in <module>
    import swift.common.client
ImportError: No module named swift.common.client

----------------------------------------------------------------------
Ran 74 tests in 5.654s

FAILED (errors=2)

Was swift removed from the pip-requires file?

Changed in glance:
status: Fix Committed → Confirmed
Revision history for this message
Rick Harris (rconradharris) wrote :

> Was swift removed from the pip-requires file?

Not that I'm aware of.

Per Cory's comments, that looks like an 'acceptable' failure. The idea being, Swift isn't needed for a production deploy (so all of the actual code must use lazy loading). But, for developers, Swift is required to run the unit-tests to prevent integration/regression bugs.

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

The tools/pip-requires file is *specifically* for developers that are running unit tests in a virtualenv. Therefore, Swift should be in the pip-requires file. So, no, it's not an acceptable failure.

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

Note: it would be an acceptable failure if I had ./run_tests.sh -N. But I didn't. I ran it in run_tests.sh -V -f

Revision history for this message
Rick Harris (rconradharris) wrote :

Gotcha, never use venv; disregard.

Jay Pipes (jaypipes)
Changed in glance:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → 2011.2
status: Fix Committed → Fix Released
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.