summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafi Khardalian <rafi@metacloud.com>2013-01-18 07:01:50 +0000
committerGerrit Code Review <review@openstack.org>2013-01-26 19:11:53 +0000
commita69251804e62f871f93ffa420978f9b61a36df9c (patch)
treea7a4e455c8527df198373fdf0d7be1ae20e79477
parente1ce3878b951ea491548c129453bb84a77205649 (diff)
downloadnova-a69251804e62f871f93ffa420978f9b61a36df9c.tar.gz
nova-a69251804e62f871f93ffa420978f9b61a36df9c.tar.xz
nova-a69251804e62f871f93ffa420978f9b61a36df9c.zip
Relax API restrictions around the use of reboot
Fixes bug 1101082 bug 982108 Reboots are the only sledge hammer users have available to resolve issues with their instances without administrative intervention. This patch modifies the API policy to allow reboot calls to be made in many more power and task states. Change-Id: Ia8702448f6b7b863da40e4d498f2e2ee0a12882e
-rw-r--r--nova/compute/api.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 06ce2e07e..6e9119f51 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -1591,8 +1591,14 @@ class API(base.Base):
@wrap_check_policy
@check_instance_lock
@check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.STOPPED,
- vm_states.RESCUED],
- task_state=[None, task_states.REBOOTING])
+ vm_states.RESCUED, vm_states.PAUSED,
+ vm_states.SUSPENDED],
+ task_state=[None, task_states.REBOOTING,
+ task_states.REBOOTING_HARD,
+ task_states.RESUMING,
+ task_states.UNPAUSING,
+ task_states.PAUSING,
+ task_states.SUSPENDING])
def reboot(self, context, instance, reboot_type):
"""Reboot the given instance."""
if (reboot_type == 'SOFT' and