Code review comment for lp:~jaypipes/glance/bug713126

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

> Jay, this may sound silly, but can you spot why I am getting this exception?
>
> 2011-02-28 14:30:49 ERROR [glance.store.swift] auch
> Traceback (most recent call last):
> File "/usr/lib/python2.6/site-packages/eventlet/wsgi.py", line 336, in
> handle_one_response
> result = self.application(self.environ, start_response)
> File "build/bdist.linux-i686/egg/webob/dec.py", line 159, in __call__
> return resp(environ, start_response)
> File "build/bdist.linux-i686/egg/routes/middleware.py", line 131, in
> __call__
> response = self.app(environ, start_response)
> File "build/bdist.linux-i686/egg/webob/dec.py", line 159, in __call__
> return resp(environ, start_response)
> File "build/bdist.linux-i686/egg/webob/dec.py", line 147, in __call__
> resp = self.call_func(req, *args, **self.kwargs)
> File "build/bdist.linux-i686/egg/webob/dec.py", line 208, in call_func
> return self.func(req, *args, **kwargs)
> File "/usr/lib/python2.6/site-packages/glance/common/wsgi.py", line 215, in
> __call__
> result = method(**arg_dict)
> File "/usr/lib/python2.6/site-packages/glance/server.py", line 352, in
> create
> self._upload_and_activate(req, image_meta)
> File "/usr/lib/python2.6/site-packages/glance/server.py", line 315, in
> _upload_and_activate
> raise e
> ImportError: No module named common.client
>
> I have swift installed in my site-packages, and I can import
> swift.common.client.Connection using the python interpreter. This exception
> occurs every time I try to upload. As the problem is here:
>
> 272 + connection_class = get_connection_class(conn_class)

It's because there is a module glance.store.swift and a module swift.common.client. Local namespacing is confusing Python into thinking it should search for "common.client" at a module path of glance.store.swift.common.client. It's a bug, and there are a couple solutions to it. Rick refers to a couple below. Working on it...

Thanks!
jay

« Back to merge proposal