Commit 37d4f294 by Dudás Ádám

vm: remove 'destroyed' property from network interfaces

parent 9e5265b4
...@@ -58,10 +58,6 @@ class Interface(Model): ...@@ -58,10 +58,6 @@ class Interface(Model):
return 'cloud-' + str(self.instance.id) + '-' + str(self.vlan.vid) return 'cloud-' + str(self.instance.id) + '-' + str(self.vlan.vid)
@property @property
def destroyed(self):
return self.instance.destroyed_at
@property
def mac(self): def mac(self):
try: try:
return self.host.mac return self.host.mac
...@@ -138,33 +134,16 @@ class Interface(Model): ...@@ -138,33 +134,16 @@ class Interface(Model):
return iface return iface
def deploy(self): def deploy(self):
if self.destroyed:
from .instance import Instance
raise Instance.InstanceDestroyedError(self.instance,
"The associated instance "
"(%s) has already been "
"destroyed" % self.instance)
net_tasks.create.apply_async( net_tasks.create.apply_async(
args=[self.get_vmnetwork_desc()], args=[self.get_vmnetwork_desc()],
queue=self.instance.get_remote_queue_name('net')) queue=self.instance.get_remote_queue_name('net'))
def shutdown(self): def shutdown(self):
if self.destroyed:
from .instance import Instance
raise Instance.InstanceDestroyedError(self.instance,
"The associated instance "
"(%s) has already been "
"destroyed" % self.instance)
queue_name = self.instance.get_remote_queue_name('net') queue_name = self.instance.get_remote_queue_name('net')
net_tasks.destroy.apply_async(args=[self.get_vmnetwork_desc()], net_tasks.destroy.apply_async(args=[self.get_vmnetwork_desc()],
queue=queue_name) queue=queue_name)
def destroy(self): def destroy(self):
if self.destroyed:
return
self.shutdown() self.shutdown()
if self.host is not None: if self.host is not None:
self.host.delete() self.host.delete()
......
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