Commit 64e19ee1 by Őry Máté

vm: yield vnc port only at destroy

parent 9831b9b0
......@@ -459,10 +459,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
except ActivityInProgressError:
pass # discard state change if another activity is in progress.
else:
if new_state == 'STOPPED':
self.vnc_port = None
self.node = None
self.save()
act.finished = act.started
act.resultant_state = new_state
act.succeeded = True
......
......@@ -629,7 +629,6 @@ class ShutdownOperation(InstanceOperation):
def _operation(self, task=None):
self.instance.shutdown_vm(task=task)
self.instance.yield_node()
self.instance.yield_vnc_port()
def on_abort(self, activity, error):
if isinstance(error, TimeLimitExceeded):
......@@ -670,9 +669,7 @@ class ShutOffOperation(InstanceOperation):
with activity.sub_activity('delete_vm'):
self.instance.delete_vm()
# Clear node and VNC port association
self.instance.yield_node()
self.instance.yield_vnc_port()
register_operation(ShutOffOperation)
......
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