Comment 23 for bug 1811235

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (stable/stein)

Reviewed: https://review.opendev.org/666638
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=cdaa80078491517af3143690d40d30a5b7591edf
Submitter: Zuul
Branch: stable/stein

commit cdaa80078491517af3143690d40d30a5b7591edf
Author: Matt Riedemann <email address hidden>
Date: Fri Jan 25 08:58:36 2019 -0500

    Change InstanceFaultRollback handling in _error_out_instance_on_exception

    For some reason, only NotImplementedError in _error_out_instance_on_exception
    would use the $instance_state parameter which can be controlled by the
    caller of the context manager to determine the rollback vm_state. But in the
    case of InstanceFaultRollback, the caller may want to reset the vm_state
    back to something other than ACTIVE, like if the instance is actually
    STOPPED and something like prep_resize fails (you can resize a STOPPED
    instance).

    This change makes _error_out_instance_on_exception handle InstanceFaultRollback
    like NotImplementedError in that the instance_state parameter is used to reset
    the instance.vm_state. It also adds a docstring explaining how this context
    manager works along with some notes/questions about ways to improve it.

    Change-Id: Ie4f9177f4d54cbc7dbcf58bd107fd5f24c60d8bb
    Related-Bug: #1811235
    (cherry picked from commit 46cb2fdfe2df333d870aca8e6afc521172b8e061)