Merge "SolidFire: Handle connect_volume() failure when create vol from image"

This commit is contained in:
Jenkins 2017-02-15 03:37:33 +00:00 committed by Gerrit Code Review
commit 398d4998d0

View File

@ -883,11 +883,12 @@ class SolidFireDriver(san.SanISCSIDriver):
tvol['provider_location'] = template_vol['provider_location']
tvol['provider_auth'] = template_vol['provider_auth']
connector = {'multipath': False}
conn = self.initialize_connection(tvol, connector)
attach_info = super(SolidFireDriver, self)._connect_device(conn)
properties = 'na'
try:
connector = {'multipath': False}
conn = self.initialize_connection(tvol, connector)
attach_info = super(SolidFireDriver, self)._connect_device(
conn)
properties = 'na'
image_utils.convert_image(tmp_image,
attach_info['device']['path'],
'raw',
@ -910,6 +911,7 @@ class SolidFireDriver(san.SanISCSIDriver):
vol['volumeID'])
self._detach_volume(context, attach_info, tvol, properties)
self._issue_api_request('DeleteVolume', params)
self._issue_api_request('PurgeDeletedVolume', params)
return
self._detach_volume(context, attach_info, tvol, properties)