From 39e252ad056ff65c7c326095938deb1eb50c4b40 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes <kiall@managedit.ie> Date: Wed, 21 Mar 2012 12:19:30 +0000 Subject: [PATCH] Fixes bug #959262 - Prevent a failure to create the cache directory from causing an exception. Change-Id: Ia80b50b32f5e3d0e76f4a1b251e23bbd3c70666e --- novaclient/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/novaclient/base.py b/novaclient/base.py index 4badc848c..ec78aa6a0 100644 --- a/novaclient/base.py +++ b/novaclient/base.py @@ -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('_', '-'))