Comment 4 for bug 1484194

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/kilo)

Reviewed: https://review.openstack.org/213761
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=fd38f1d7b7a8d7f09b40dae1190d5a7330bd18d6
Submitter: Jenkins
Branch: stable/kilo

commit fd38f1d7b7a8d7f09b40dae1190d5a7330bd18d6
Author: Walter A. Boring IV <email address hidden>
Date: Wed Aug 12 14:00:54 2015 -0700

    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.

    Conflicts:
            cinder/tests/test_volume.py
            cinder/volume/manager.py

    NOTE(mriedem): The conflicts are due to commit
    386e2858a4e76fafc1d78737154859a3c1618b20 not being in stable/kilo
    and I don't plan on backporting that since it's based on the level
    of oslo.log used in Liberty. This does mean the info messages in
    the detach_volume method in the volume manager are not exactly
    the same as what is in the original change in Liberty. Rather than
    using the resource=volume kwarg, we just log the volume_id like the
    error messages were before this change.

    Change-Id: I11b7c45bb6570ce11e13e487cf1136ca2551036b
    Closes-Bug: #1484194
    Related-Bug: #1476806
    (cherry picked from commit 3b4e8c31a2c94cac3e1a5c071eb38c7d5cb9a239)