Browse Source

Merge "NetApp SolidFire: Refactor DuplicateSfVolumeNames exception" into stable/victoria

changes/00/785700/1
Zuul 1 month ago
committed by Gerrit Code Review
parent
commit
5e67917fa9
1 changed files with 7 additions and 9 deletions
  1. +7
    -9
      cinder/volume/drivers/solidfire.py

+ 7
- 9
cinder/volume/drivers/solidfire.py View File

@ -132,10 +132,6 @@ xVolumeAccessGroupIDDoesNotExist = 'xVolumeAccessGroupIDDoesNotExist'
xNotInVolumeAccessGroup = 'xNotInVolumeAccessGroup'
class DuplicateSfVolumeNames(exception.Duplicate):
message = _("Detected more than one volume with name %(vol_name)s")
class SolidFireAPIException(exception.VolumeBackendAPIException):
message = _("Bad response from SolidFire API")
@ -170,6 +166,11 @@ class SolidFireDataSyncTimeoutError(exception.VolumeBackendAPIException):
message = _("Data sync volumes timed out")
class SolidFireDuplicateVolumeNames(SolidFireDriverException):
message = _("Volume name [%(vol_name)s] already exists "
"in the SolidFire backend.")
def retry(exc_tuple, tries=5, delay=1, backoff=2):
def retry_dec(f):
@six.wraps(f)
@ -1049,10 +1050,7 @@ class SolidFireDriver(san.SanISCSIDriver):
sf_volume_name = params['name']
volumes_found = self._list_volumes_by_name(sf_volume_name)
if volumes_found:
msg = ('Volume name [%s] already exists '
'in SolidFire backend.') % sf_volume_name
LOG.error(msg)
raise DuplicateSfVolumeNames(message=msg)
raise SolidFireDuplicateVolumeNames(vol_name=sf_volume_name)
sf_volid = None
try:
@ -1222,7 +1220,7 @@ class SolidFireDriver(san.SanISCSIDriver):
LOG.error("Found %(count)s volumes mapped to id: %(uuid)s.",
{'count': found_count,
'uuid': uuid})
raise DuplicateSfVolumeNames(vol_name=uuid)
raise SolidFireDuplicateVolumeNames(vol_name=uuid)
return sf_volref


Loading…
Cancel
Save