Skip to content

Commit

Permalink
Improve provider_location cleanup code for RBD.
Browse files Browse the repository at this point in the history
The RBD driver does not make use of the 'provider_location' field
but the current cleanup code assumes it does.  Ensure the field
is in use before testing whether or not it needs fixing.

Fixes bug 1083818.

Change-Id: Id6ff85101f85e70575ba244c2df7aca0196cf224
  • Loading branch information
Adam Gandelman committed Nov 28, 2012
1 parent d81113f commit d030c5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cinder/volume/manager.py
Expand Up @@ -374,7 +374,8 @@ def detach_volume(self, context, volume_id):

# Check for https://bugs.launchpad.net/cinder/+bug/1065702
volume_ref = self.db.volume_get(context, volume_id)
if volume_ref['name'] not in volume_ref['provider_location']:
if (volume_ref['provider_location'] and
volume_ref['name'] not in volume_ref['provider_location']):
self.driver.ensure_export(context, volume_ref)

def _copy_image_to_volume(self, context, volume, image_id):
Expand Down

0 comments on commit d030c5b

Please sign in to comment.