Commit 991984db by Dudás Ádám

vm: add status checking to network interface shutdown method

parent 42639f3a
...@@ -150,9 +150,16 @@ class Interface(Model): ...@@ -150,9 +150,16 @@ class Interface(Model):
queue=self.instance.get_remote_queue_name('net')) queue=self.instance.get_remote_queue_name('net'))
def shutdown(self): def shutdown(self):
net_tasks.destroy.apply_async( if self.destroyed:
args=[self.get_vmnetwork_desc()], from .instance import Instance
queue=self.instance.get_remote_queue_name('net')) raise Instance.InstanceDestroyedError(self.instance,
"The associated instance "
"(%s) has already been "
"destroyed" % self.instance)
queue_name = self.instance.get_remote_queue_name('net')
net_tasks.destroy.apply_async(args=[self.get_vmnetwork_desc()],
queue=queue_name)
def destroy(self): def destroy(self):
if self.destroyed: if self.destroyed:
......
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