From: peter_wang Date: Mon, 14 Dec 2015 03:37:41 +0000 (-0500) Subject: Skip check whether volume is local if it's None X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=fbcd43a6880295fdc8424b0a63ac8444a530883b;p=openstack-build%2Fcinder-build.git 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 --- 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")