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)
Reviewed: https:/ /review. opendev. org/666638 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=cdaa8007849 1517af3143690d4 0d30a5b7591edf
Committed: https:/
Submitter: Zuul
Branch: stable/stein
commit cdaa80078491517 af3143690d40d30 a5b7591edf
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 d870aca8e6afc52 1172b8e061)
Related-Bug: #1811235
(cherry picked from commit 46cb2fdfe2df333