Softreboot can be done when the instance not in active status
When the instance is not in active status, softreboot is not allowed. Change-Id: I3fa13f0590b81de32e33708456b00828598009db Close-Bug: #1671694
This commit is contained in:
parent
be94c29410
commit
3761256e37
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user