blob: ba454e759d7ea3c65a6101c477e5e73f64d2afc8 [file] [log] [blame]
from core.models import Instance, SliceDeployments
from synchronizers.base.deleter import Deleter
class InstanceDeleter(Deleter):
model='Instance'
def call(self, pk):
instance = Instance.objects.get(pk=pk)
if instance.instance_id:
driver = self.driver.client_driver(caller=instance.creator,
tenant=instance.slice.name,
deployment=instance.deploymentNetwork.name)
driver.destroy_instance(instance.instance_id)
instance.delete()