Commit 19cdda94 by Őry Máté

vm: fix typos

parent a89d41d2
...@@ -46,6 +46,14 @@ class Operation(object): ...@@ -46,6 +46,14 @@ class Operation(object):
abortable = False abortable = False
has_percentage = False has_percentage = False
@property
def activity_code_suffix(self):
return getattr(self, "_real_activity_code_suffix", self.id)
@activity_code_suffix.setter
def activity_code_suffix(self, value):
self._real_activity_code_suffix = value
def __call__(self, **kwargs): def __call__(self, **kwargs):
return self.call(**kwargs) return self.call(**kwargs)
......
...@@ -56,7 +56,7 @@ class RemoteOperationMixin(object): ...@@ -56,7 +56,7 @@ class RemoteOperationMixin(object):
remote_timeout = 30 remote_timeout = 30
def _operation(self, **kwargs): def _operation(self, **kwargs):
args = self._get_remote_args(**kwargs), args = self._get_remote_args(**kwargs)
return self.task.apply_async( return self.task.apply_async(
args=args, queue=self._get_remote_queue() args=args, queue=self._get_remote_queue()
).get(timeout=self.remote_timeout) ).get(timeout=self.remote_timeout)
...@@ -92,7 +92,6 @@ class InstanceOperation(Operation): ...@@ -92,7 +92,6 @@ class InstanceOperation(Operation):
accept_states = None accept_states = None
deny_states = None deny_states = None
resultant_state = None resultant_state = None
activity_code_suffix = property(lambda self: self.id)
def __init__(self, instance): def __init__(self, instance):
super(InstanceOperation, self).__init__(subject=instance) super(InstanceOperation, self).__init__(subject=instance)
...@@ -358,10 +357,10 @@ class DeployOperation(InstanceOperation): ...@@ -358,10 +357,10 @@ class DeployOperation(InstanceOperation):
"wait operating system loading"), interruptible=True) "wait operating system loading"), interruptible=True)
@register_operation @register_operation
class DeployVmOperation(SubOperationMixin, InstanceOperation): class DeployVmOperation(SubOperationMixin, RemoteInstanceOperation):
id = "_deploy_vm" id = "_deploy_vm"
name = _("deploy vm") name = _("deploy vm")
description = _("Deploy all associated disks.") description = _("Deploy virtual machine.")
remote_queue = ("vm", "slow") remote_queue = ("vm", "slow")
task = vm_tasks.deploy task = vm_tasks.deploy
...@@ -392,7 +391,7 @@ class DeployOperation(InstanceOperation): ...@@ -392,7 +391,7 @@ class DeployOperation(InstanceOperation):
# deploy disk # deploy disk
disk.deploy() disk.deploy()
class ResumeVmOperation(SubOperationMixin, InstanceOperation): class ResumeVmOperation(SubOperationMixin, RemoteInstanceOperation):
id = "_resume_vm" id = "_resume_vm"
name = _("boot virtual machine") name = _("boot virtual machine")
remote_queue = ("vm", "slow") remote_queue = ("vm", "slow")
...@@ -918,7 +917,6 @@ class NodeOperation(Operation): ...@@ -918,7 +917,6 @@ class NodeOperation(Operation):
host_cls = Node host_cls = Node
online_required = True online_required = True
superuser_required = True superuser_required = True
activity_code_suffix = property(lambda self: self.id)
def __init__(self, node): def __init__(self, node):
super(NodeOperation, self).__init__(subject=node) super(NodeOperation, self).__init__(subject=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