'new_user', 'new_project'),
expected)
+ def test_accept_transfer_volume_not_found_raises(self):
+ sfv = SolidFireDriver(configuration=self.configuration)
+ self.stubs.Set(SolidFireDriver, '_issue_api_request',
+ self.fake_issue_api_request)
+ testvol = {'project_id': 'testprjid',
+ 'name': 'test_volume',
+ 'size': 1,
+ 'id': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
+ 'created_at': timeutils.utcnow()}
+ self.assertRaises(exception.VolumeNotFound,
+ sfv.accept_transfer,
+ self.ctxt,
+ testvol,
+ 'new_user',
+ 'new_project')
+
def test_retype(self):
sfv = SolidFireDriver(configuration=self.configuration)
self.stubs.Set(SolidFireDriver, '_issue_api_request',
1.1 - Refactor, clone support, qos by type and minor bug fixes
1.2 - Add xfr and retype support
1.2.1 - Add export/import support
+ 1.2.2 - Catch VolumeNotFound on accept xfr
"""
- VERSION = '1.2.1'
+ VERSION = '1.2.2'
sf_qos_dict = {'slow': {'minIOPS': 100,
'maxIOPS': 200,
return qos
def _get_sf_volume(self, uuid, params):
+ # TODO(jdg): Going to fix this shortly to not iterate
+ # but instead use the cinder UUID and our internal
+ # mapping to get this more efficiently
data = self._issue_api_request('ListVolumesForAccount', params)
if 'result' not in data:
msg = _("Failed to get SolidFire Volume: %s") % data
sfaccount = self._get_sfaccount(volume['project_id'])
if sfaccount is None:
LOG.error(_("Account for Volume ID %s was not found on "
- "the SolidFire Cluster!") % volume['id'])
+ "the SolidFire Cluster while attempting "
+ "delete_volume operation!") % volume['id'])
LOG.error(_("This usually means the volume was never "
"successfully created."))
return
raise exception.SolidFireAPIException(msg)
else:
LOG.error(_("Volume ID %s was not found on "
- "the SolidFire Cluster!"), volume['id'])
+ "the SolidFire Cluster while attempting "
+ "delete_volume operation!"), volume['id'])
LOG.debug("Leaving SolidFire delete_volume")
if sf_vol is None:
LOG.error(_("Volume ID %s was not found on "
- "the SolidFire Cluster!"), volume['id'])
+ "the SolidFire Cluster while attempting "
+ "extend_volume operation!"), volume['id'])
raise exception.VolumeNotFound(volume_id=volume['id'])
params = {
sf_vol = self._get_sf_volume(volume['id'], params)
if sf_vol is None:
LOG.error(_("Volume ID %s was not found on "
- "the SolidFire Cluster!"), volume['id'])
+ "the SolidFire Cluster while attempting "
+ "attach_volume operation!"), volume['id'])
raise exception.VolumeNotFound(volume_id=volume['id'])
attributes = sf_vol['attributes']
sf_vol = self._get_sf_volume(volume['id'], params)
if sf_vol is None:
LOG.error(_("Volume ID %s was not found on "
- "the SolidFire Cluster!"), volume['id'])
+ "the SolidFire Cluster while attempting "
+ "detach_volume operation!"), volume['id'])
raise exception.VolumeNotFound(volume_id=volume['id'])
attributes = sf_vol['attributes']
sfaccount = self._get_sfaccount(volume['project_id'])
params = {'accountID': sfaccount['accountID']}
sf_vol = self._get_sf_volume(volume['id'], params)
-
+ if sf_vol is None:
+ LOG.error(_("Volume ID %s was not found on "
+ "the SolidFire Cluster while attempting "
+ "accept_transfer operation!"), volume['id'])
+ raise exception.VolumeNotFound(volume_id=volume['id'])
if new_project != volume['project_id']:
# do a create_sfaccount here as this tenant
# may not exist on the cluster yet
sfaccount = self._get_sfaccount(volume['project_id'])
if sfaccount is None:
LOG.error(_("Account for Volume ID %s was not found on "
- "the SolidFire Cluster!") % volume['id'])
+ "the SolidFire Cluster while attempting "
+ "unmanage operation!") % volume['id'])
raise exception.SolidFireAPIException("Failed to find account "
"for volume.")