yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #01848
[Bug 1157765] Re: glance-cache-prefetcher explodes when no auth parameters were configured
Reviewed: https://review.openstack.org/25371
Committed: http://github.com/openstack/glance/commit/9f336df06409b4e37e1737978cf7187a4172ca74
Submitter: Jenkins
Branch: milestone-proposed
commit 9f336df06409b4e37e1737978cf7187a4172ca74
Author: Flaper Fesp <flaper87@xxxxxxxxx>
Date: Thu Mar 21 10:05:05 2013 +0100
Check if creds are present and not None
Currently, KeystoneStrategy checks whether the required credentials are
present in the creds dict but it doesn't check whether they are valid or
not.
This patch checks whether the required creds are present and not None
otherwise a MissingCredentials exception will be raised.
Note: No need for checking parameters' values types since they'll be
instances of basestring once set otherwise they'll be None.
Fixes bug 1157765
Change-Id: I664a604c3cbf2fca60a88c4d887cd9a4b678c8a5
(cherry picked from commit 855162b0b1fc62b60f0f350d3258334711e12aec)
** Changed in: glance
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1157765
Title:
glance-cache-prefetcher explodes when no auth parameters were
configured
Status in OpenStack Image Registry and Delivery Service (Glance):
Fix Released
Bug description:
Description of problem:
If there're no auth parameters configured in glance-cache.conf,
glance-cache-prefetcher fails and prints a traceback.
How reproducible:
very
Steps to Reproduce:
1. install glance
2. configure cachemanager
3. use keystone as auth backend
4. queue an image for cache
5. remove keystone parameters from glance-cache.conf
6. call glance-cache-prefetcher
Actual results:
[root@interceptor glance(keystone_admin)]# glance-cache-prefetcher --debug
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/eventlet/hubs/hub.py", line 336, in fire_timers
timer()
File "/usr/lib/python2.6/site-packages/eventlet/hubs/timer.py", line 56, in __call__
cb(*args, **kw)
File "/usr/lib/python2.6/site-packages/eventlet/greenthread.py", line 192, in main
result = function(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/image_cache/prefetcher.py", line 53, in fetch_image_into_cache
image_meta = registry.get_image_metadata(ctx, image_id)
File "/usr/lib/python2.6/site-packages/glance/registry/__init__.py", line 133, in get_image_metadata
return c.get_image(image_id)
File "/usr/lib/python2.6/site-packages/glance/registry/client.py", line 121, in get_image
res = self.do_request("GET", "/images/%s" % image_id)
File "/usr/lib/python2.6/site-packages/glance/registry/client.py", line 89, in do_request
action, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 63, in wrapped
return func(self, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 440, in do_request
self._authenticate()
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 418, in _authenticate
auth_plugin.authenticate()
File "/usr/lib/python2.6/site-packages/glance/common/auth.py", line 125, in authenticate
self.check_auth_params()
File "/usr/lib/python2.6/site-packages/glance/common/auth.py", line 94, in check_auth_params
if self.creds['auth_url'].rstrip('/').endswith('v2.0'):
AttributeError: 'NoneType' object has no attribute 'rstrip'
Traceback (most recent call last):
File "/usr/bin/glance-cache-prefetcher", line 53, in <module>
app.run()
File "/usr/lib/python2.6/site-packages/glance/image_cache/prefetcher.py", line 80, in run
successes = sum([1 for r in results if r is True])
File "/usr/lib/python2.6/site-packages/eventlet/greenpool.py", line 232, in next
val = self.waiters.get().wait()
File "/usr/lib/python2.6/site-packages/eventlet/greenthread.py", line 166, in wait
return self._exit_event.wait()
File "/usr/lib/python2.6/site-packages/eventlet/event.py", line 120, in wait
current.throw(*self._exc)
File "/usr/lib/python2.6/site-packages/eventlet/greenthread.py", line 192, in main
result = function(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/image_cache/prefetcher.py", line 53, in fetch_image_into_cache
image_meta = registry.get_image_metadata(ctx, image_id)
File "/usr/lib/python2.6/site-packages/glance/registry/__init__.py", line 133, in get_image_metadata
return c.get_image(image_id)
File "/usr/lib/python2.6/site-packages/glance/registry/client.py", line 121, in get_image
res = self.do_request("GET", "/images/%s" % image_id)
File "/usr/lib/python2.6/site-packages/glance/registry/client.py", line 89, in do_request
action, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 63, in wrapped
return func(self, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 440, in do_request
self._authenticate()
File "/usr/lib/python2.6/site-packages/glance/common/client.py", line 418, in _authenticate
auth_plugin.authenticate()
File "/usr/lib/python2.6/site-packages/glance/common/auth.py", line 125, in authenticate
self.check_auth_params()
File "/usr/lib/python2.6/site-packages/glance/common/auth.py", line 94, in check_auth_params
if self.creds['auth_url'].rstrip('/').endswith('v2.0'):
AttributeError: 'NoneType' object has no attribute 'rstrip'
Expected results:
A nice error message requesting auth parameters
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1157765/+subscriptions