Ignored ImportError in swift store kills devstack

Bug #1011885 reported by Gabriel Hurley
This bug report is a duplicate of:  Bug #1002791: glance should use python-swiftclient. Edit Remove
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Chmouel Boudjnah
OpenStack Core Infrastructure
New
Undecided
Unassigned
OpenStack Object Storage (swift)
Invalid
Undecided
Unassigned
devstack
Fix Committed
Undecided
Chmouel Boudjnah

Bug Description

The ignored ImportError here:

https://github.com/openstack/glance/blob/master/glance/store/swift.py#L35

causes that module to become useless should the import fail for any *other* reason besides swift not being installed.

For example, with current master devstack, adding "swift" to the ENABLED_SERVICES, image uploads fail with the following:

2012-06-11 15:51:42 ERROR [glance.api.v1.images] Traceback (most recent call last):
  File "/opt/stack/glance/glance/api/v1/images.py", line 390, in _upload
    image_size)
  File "/opt/stack/glance/glance/store/swift.py", line 369, in add
    auth_url=self.full_auth_address, user=self.user, key=self.key)
  File "/opt/stack/glance/glance/store/swift.py", line 319, in _make_swift_connection
    return swift_client.Connection(
NameError: global name 'swift_client' is not defined

This in turn causes the devstack run to fail out, leaving a half-installed devstack.

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

Install swiftclient. This isn't a bug in Glance. It's by design. If you don't have httplib2 installed, half the clients in OpenStack won't work. Is that the problem with the client or the program installing the client (i.e. devstack)?

Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

@Jay: installing swiftclient won't fix "from swift.common import client"... swift.common no longer exists.

Beyond that, I don't really care who's fault it is. It's everybody's problem. Glance should raise a configuration error if the backend store is set to swift but it fails to import the swift client, if you ask me.

Devstack should... well, make sure their script works? Work closer with the CI team?

Swift should coordinate with other projects to make sure they don't excise code that's being depended on, or something.

It's late, and it's been a long day. I added all three projects because it's relevant to all of you, even if the fix is only in one or two.

Revision history for this message
Thierry Carrez (ttx) wrote :

Added openstack-ci to cover the question of why swift is not enabled in devstack gate.

Changed in devstack:
status: New → Fix Committed
Changed in glance:
assignee: nobody → Chmouel Boudjnah (chmouel)
Changed in swift:
status: New → Invalid
Changed in devstack:
assignee: nobody → Chmouel Boudjnah (chmouel)
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

@Gabriel review https://review.openstack.org/#/c/7668/ should address that for glance it was ready for a while but since the change was merged pretty late for my TZ I could not update it until this morning.

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.