From c47ec154578e505eba9c81a8c90ef82703c697af Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 8 Dec 2015 13:06:56 -0500 Subject: [PATCH] Consider 'in-use' a non-pending volume for caching We don't cache volume list if one of the volumes is in pending state, as otherwise we'd miss the cloud-side cache invalidation. However, active volumes that are attached are in state "in-use" - so basically if you had one active volume, the cache would never cache. Change-Id: I03cbc1b814e4a5829936a22751ee81d52b83fb2e --- releasenotes/notes/cache-in-use-volumes-c7fa8bb378106fe3.yaml | 4 ++++ shade/openstackcloud.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/cache-in-use-volumes-c7fa8bb378106fe3.yaml diff --git a/releasenotes/notes/cache-in-use-volumes-c7fa8bb378106fe3.yaml b/releasenotes/notes/cache-in-use-volumes-c7fa8bb378106fe3.yaml new file mode 100644 index 000000000..4ac0b61af --- /dev/null +++ b/releasenotes/notes/cache-in-use-volumes-c7fa8bb378106fe3.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - Fixed caching the volume list when volumes are in + use. diff --git a/shade/openstackcloud.py b/shade/openstackcloud.py index dc8471696..35708a19d 100644 --- a/shade/openstackcloud.py +++ b/shade/openstackcloud.py @@ -65,7 +65,7 @@ OBJECT_CONTAINER_ACLS = { def _no_pending_volumes(volumes): '''If there are any volumes not in a steady state, don't cache''' for volume in volumes: - if volume['status'] not in ('available', 'error'): + if volume['status'] not in ('available', 'error', 'in-use'): return False return True