commit 46cb2fdfe2df333d870aca8e6afc521172b8e061
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.
Reviewed: https:/ /review. opendev. org/633212 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=46cb2fdfe2d f333d870aca8e6a fc521172b8e061
Committed: https:/
Submitter: Zuul
Branch: master
commit 46cb2fdfe2df333 d870aca8e6afc52 1172b8e061
Author: Matt Riedemann <email address hidden>
Date: Fri Jan 25 08:58:36 2019 -0500
Change InstanceFaultRo llback handling in _error_ out_instance_ on_exception
For some reason, only NotImplementedError in _error_ out_instance_ on_exception llback, the caller may want to reset the vm_state
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 InstanceFaultRo
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 InstanceFaultRo llback
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: Ie4f9177f4d54cb c7dbcf58bd107fd 5f24c60d8bb
Related-Bug: #1811235