Commit 54080b7a by Guba Sándor

instance: added proper resultant_state

parent 2b0eb332
...@@ -761,8 +761,12 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -761,8 +761,12 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
def shut_off(self, user=None, task_uuid=None): def shut_off(self, user=None, task_uuid=None):
"""Shut off VM. (plug-out) """Shut off VM. (plug-out)
""" """
def __on_commit(activity):
activity.resultant_state = 'STOPPED'
with instance_activity(code_suffix='shut_off', instance=self, with instance_activity(code_suffix='shut_off', instance=self,
task_uuid=task_uuid, user=user) as act: task_uuid=task_uuid, user=user,
on_commit=__on_commit) as act:
# Destroy VM # Destroy VM
if self.node: if self.node:
self.__destroy_vm(act) self.__destroy_vm(act)
......
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