Comment 3 for bug 1765742

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/563213
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=717d09149ebea4d6451efb262f2b300cdbcf2208
Submitter: Zuul
Branch: master

commit 717d09149ebea4d6451efb262f2b300cdbcf2208
Author: Matt Riedemann <email address hidden>
Date: Fri Apr 20 14:18:39 2018 -0400

    Fix detach_volume calls when rolling back a failed attach

    Change I751fcb7532679905c4279744919c6cce84a11eb4 modified
    the ComputeDriver.detach_volume method signature to pass
    the RequestContext as the first argument. This was missed
    in the volume attach rollback code where the driver.detach_volume
    method is called. It was missed because that is called
    in a try/except block which catches generic Exception, which
    also means that the unit test covering that flow, which
    raised an Exception, was not failing.

    This change fixes the code bug and re-writes the test to
    use mock rather than mox and explicitly assert the calls made.

    An alternative to this would be changing the generic
    Exception handling in the rollback code, however, the
    virt drivers raise things other than NovaException, like
    os-brick exceptions and libvirtError, so refactoring that
    error handling is non-trivial.

    Change-Id: I9bafd4c47489b61973302310720b11ec1b5e0374
    Closes-Bug: #1765742