Merge "Softreboot can be done when the instance not in active status"

This commit is contained in:
Jenkins 2017-03-17 11:13:49 +00:00 committed by Gerrit Code Review
commit e788fc50d6

View File

@ -171,6 +171,12 @@ class SoftRebootInstance(RebootInstance):
def action(self, request, obj_id):
api.nova.server_reboot(request, obj_id, soft_reboot=True)
def allowed(self, request, instance=None):
if instance is not None:
return instance.status in ACTIVE_STATES
else:
return True
class TogglePause(tables.BatchAction):
name = "pause"