blob: 097f0f767414b77d26525d3fe09e9b1e3b7163e7 [file] [log] [blame]
Sapan Bhatiabf7856b2014-11-19 15:09:38 -05001from core.models import Sliver, SliceDeployments
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04002from observer.deleter import Deleter
3
4class SliverDeleter(Deleter):
5 model='Sliver'
6
7 def call(self, pk):
8 sliver = Sliver.objects.get(pk=pk)
9 if sliver.instance_id:
10 driver = self.driver.client_driver(caller=sliver.creator,
11 tenant=sliver.slice.name,
12 deployment=sliver.deploymentNetwork.name)
13 driver.destroy_instance(sliver.instance_id)
14 sliver.delete()