]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Get volume from db again before updating it's status
authorAbhijeet Malawade <Abhijeet.Malawade@nttdata.com>
Mon, 22 Dec 2014 13:50:28 +0000 (05:50 -0800)
committerAbhijeet Malawade <Abhijeet.Malawade@nttdata.com>
Wed, 1 Apr 2015 13:45:50 +0000 (06:45 -0700)
commit4d6ddcb94435a20476536f4956de88ce4ab15b66
tree17a05ff16e5184904c7fa4094c57a4722182220e
parentbef2256e931cfa0756de874ac18fdfc12e32b7fc
Get volume from db again before updating it's status

During uploading a volume which is attached to an instance to image service,
if the instance is deleted then the volume remains in "in-use" status.
So get the volume again from db before updating it's status.

Added new db api called 'volume_update_status_based_on_attachment'.
It gets volume from db and updates its status using the same session.

Closes-Bug: #1406703
Change-Id: I01d313438f021cd2fe0d6f5c23f2029279d4b55a
cinder/db/api.py
cinder/db/sqlalchemy/api.py
cinder/tests/test_volume.py
cinder/volume/manager.py