Commit 6c725c6d by Guba Sándor

operation: added ChangeStateOperation

parent b4b966f0
...@@ -638,6 +638,22 @@ class RenewOperation(InstanceOperation): ...@@ -638,6 +638,22 @@ class RenewOperation(InstanceOperation):
register_operation(RenewOperation) register_operation(RenewOperation)
class ChangeStateOperation(InstanceOperation):
activity_code_suffix = 'change_state'
id = 'change_state'
name = _("change state")
description = _("Change the virtual machine state to NOSTATE")
acl_level = "owner"
required_perms = ('vm.change_state', )
def _operation(self, user, activity, new_state="NOSTATE",
reason=None, lease=None):
activity.resultant_state = new_state
register_operation(ChangeStateOperation)
class NodeOperation(Operation): class NodeOperation(Operation):
async_operation = abortable_async_node_operation async_operation = abortable_async_node_operation
host_cls = Node host_cls = Node
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment