Commit dd6a8445 by Bach Dániel

vm: review resultant state

Closes #382
parent e5276242
......@@ -377,7 +377,12 @@ class DeployOperation(InstanceOperation):
self.instance.allocate_node()
# Deploy virtual images
self.instance._deploy_disks(parent_activity=activity)
try:
self.instance._deploy_disks(parent_activity=activity)
except:
self.instance.yield_node()
self.instance.yield_vnc_port()
raise
# Deploy VM on remote machine
if self.instance.state not in ['PAUSED']:
......@@ -452,6 +457,9 @@ class DestroyOperation(InstanceOperation):
required_perms = ()
resultant_state = 'DESTROYED'
def on_abort(self, activity, error):
activity.resultant_state = None
def _operation(self, activity, system):
# Destroy networks
with activity.sub_activity(
......
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