]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Don't return Exception when volume is detached
authorWalter A. Boring IV <walter.boring@hp.com>
Wed, 12 Aug 2015 21:00:54 +0000 (14:00 -0700)
committerWalter A. Boring IV (hemna) <walter.boring@hp.com>
Thu, 13 Aug 2015 16:36:41 +0000 (16:36 +0000)
commit3b4e8c31a2c94cac3e1a5c071eb38c7d5cb9a239
treeb1449b4b4ec57a0199ffcea8ddd80ec6387df4fe
parent9bd6fa690bce14be1161d55f0e03d0b907830138
Don't return Exception when volume is detached

This patch changes the way we handle volume detach
attempts when the attachment_id is already detached
and/or when the volume has no attachments.  We now
handle this the same way we do with deleting volumes
that don't exist.  We return success.

This patch also takes care to make sure we safely reset
the volume status to what it should be depending on if
there are other attachments.  If the attachment_id is
passed in and that attachment is detached, but there are
other attachments, we want to make sure that the volume is
left in an in-use state, not available.

Change-Id: I11b7c45bb6570ce11e13e487cf1136ca2551036b
Closes-Bug: #1484194
Related-Bug: #1476806
cinder/db/sqlalchemy/api.py
cinder/tests/unit/test_volume.py
cinder/volume/manager.py