]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Return updated volume object to the caller of _attach_volume()
authorMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Wed, 18 Mar 2015 15:48:25 +0000 (11:48 -0400)
committerMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Wed, 18 Mar 2015 18:17:36 +0000 (14:17 -0400)
commitbbf1b4950fed90338aa38cd93f41fc86d5a66f99
tree4acc906f80724d2caf6bad5976daebdc8c014cbc
parentca5e4ac24d12765cb6f1e403574de554893bd87e
Return updated volume object to the caller of _attach_volume()

Currently, migrate volume between two back-ends using LIO scsi
target fails due to the error of "Unable to terminate volume
connection: 'NoneType' object has no attribute 'split'".

The root cause of this error is _detach_volume() during volume
migration does not use updated volume object which is updated
during _attach_volume() by create_export().
As a result terminate_connection() which is called from
_detach_volume() tries to split volume['provider_location']
even if the entry is None and causes above error.

Also same error would be happened following methods.

- copy_volume_data(-> volume migration)
- backup_volume
- restore_backup
- copy_image_to_volume
- copy_volume_to_image

This change adds updated volume as an additional return value
for _attach_volume().

Change-Id: I7b76941d8b2e761c2c0147b13a201583d7e0a1c4
Closes-Bug: #1433360
cinder/tests/test_volume.py
cinder/volume/driver.py