Commit 37d4f294 by Dudás Ádám

vm: remove 'destroyed' property from network interfaces

parent 9e5265b4
......@@ -58,10 +58,6 @@ class Interface(Model):
return 'cloud-' + str(self.instance.id) + '-' + str(self.vlan.vid)
@property
def destroyed(self):
return self.instance.destroyed_at
@property
def mac(self):
try:
return self.host.mac
......@@ -138,33 +134,16 @@ class Interface(Model):
return iface
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(
args=[self.get_vmnetwork_desc()],
queue=self.instance.get_remote_queue_name('net'))
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')
net_tasks.destroy.apply_async(args=[self.get_vmnetwork_desc()],
queue=queue_name)
def destroy(self):
if self.destroyed:
return
self.shutdown()
if self.host is not None:
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