From fbcd43a6880295fdc8424b0a63ac8444a530883b Mon Sep 17 00:00:00 2001 From: peter_wang Date: Sun, 13 Dec 2015 22:37:41 -0500 Subject: [PATCH] Skip check whether volume is local if it's None When force deleting a consistency group containing volumes, manager.py tries to extract host field to check whether the volume is local to this cinder node before deleting the volume. Above logic is invalid if host field of faulted volume is None. This fix will bypass above check to allow deletion of the volume. Change-Id: I477c80c21c0b554b69c6222fb4fb0461813ac2bb Closes-Bug: 1524195 --- cinder/volume/manager.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index d63e2360c..02e8a9bba 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -2646,10 +2646,11 @@ class VolumeManager(manager.SchedulerDependentManager): # self.host is 'host@backend' # volume_ref['host'] is 'host@backend#pool' # Extract host before doing comparison - new_host = vol_utils.extract_host(volume_ref['host']) - if new_host != self.host: - raise exception.InvalidVolume( - reason=_("Volume is not local to this node")) + if volume_ref['host']: + new_host = vol_utils.extract_host(volume_ref['host']) + if new_host != self.host: + raise exception.InvalidVolume( + reason=_("Volume is not local to this node")) self._notify_about_consistencygroup_usage( context, group, "delete.start") -- 2.45.2