mox.IgnoreArg()).AndRaise(exception.VolumeIsBusy(
volume_name='fake'))
self.mox.ReplayAll()
- res = self.volume.delete_volume(self.context, volume_id)
- self.assertTrue(res)
+ self.volume.delete_volume(self.context, volume_id)
volume_ref = db.volume_get(context.get_admin_context(), volume_id)
self.assertEqual(volume_id, volume_ref.id)
self.assertEqual("available", volume_ref.status)
def test_delete_volume_not_found(self, mock_get_volume):
"""Test delete volume moves on if the volume does not exist."""
volume_id = '12345678-1234-5678-1234-567812345678'
- self.assertTrue(self.volume.delete_volume(self.context, volume_id))
+ self.volume.delete_volume(self.context, volume_id)
self.assertTrue(mock_get_volume.called)
@mock.patch('cinder.volume.drivers.lvm.LVMVolumeDriver.'
# be deleted when resuming deletes from init_host().
LOG.debug("Attempted delete of non-existent volume: %s",
volume_id)
- return True
+ return
if context.project_id != volume.project_id:
project_id = volume.project_id
# record to avoid user confusion.
self._clear_db(context, is_migrating_dest, volume,
'available')
- return True
+ return
except Exception:
with excutils.save_and_reraise_exception():
# If this is a destination volume, we have to clear the
self.publish_service_capabilities(context)
LOG.info(_LI("Deleted volume successfully."), resource=volume)
- return True
def _clear_db(self, context, is_migrating_dest, volume_ref, status):
# This method is called when driver.unmanage() or
resource=snapshot)
snapshot.status = 'available'
snapshot.save()
- return True
+ return
except Exception:
with excutils.save_and_reraise_exception():
snapshot.status = 'error_deleting'
QUOTAS.commit(context, reservations, project_id=project_id)
LOG.info(_LI("Delete snapshot completed successfully"),
resource=snapshot)
- return True
def attach_volume(self, context, volume_id, instance_uuid, host_name,
mountpoint, mode):
resource={'type': 'consistency_group',
'id': group.id})
- return True
-
def update_consistencygroup(self, context, group,
add_volumes=None, remove_volumes=None):
"""Updates consistency group.
resource={'type': 'consistency_group',
'id': group.id})
- return True
-
def create_cgsnapshot(self, context, cgsnapshot):
"""Creates the cgsnapshot."""
caller_context = context
self._notify_about_cgsnapshot_usage(context, cgsnapshot, "delete.end",
snapshots)
- return True
-
def update_migrated_volume(self, ctxt, volume, new_volume,
volume_status):
"""Finalize migration process on backend device."""