Fixes bug #959262 - Prevent a failure to create the cache directory from causing an exception.

Change-Id: Ia80b50b32f5e3d0e76f4a1b251e23bbd3c70666e
This commit is contained in:
Kiall Mac Innes 2012-03-21 12:19:30 +00:00
parent 3d9a2284d3
commit 39e252ad05

@ -114,10 +114,10 @@ class Manager(utils.HookableMixin):
try:
os.makedirs(cache_dir, 0755)
except OSError as e:
if e.errno == errno.EEXIST:
pass
else:
raise
# NOTE(kiall): This is typicaly either permission denied while
# attempting to create the directory, or the directory
# already exists. Either way, don't fail.
pass
resource = obj_class.__name__.lower()
filename = "%s-%s-cache" % (resource, cache_type.replace('_', '-'))