blob: db344cd1a7c99a49a36f5d02ddcb18bab8715e36 [file] [log] [blame]
from core.models import Site, SiteDeployment
from observer.deleter import Deleter
class SiteDeploymentDeleter(Deleter):
model='SiteDeployment'
def call(self, pk):
site_deployment = SiteDeployment.objects.get(pk=pk)
if site_deployment.tenant_id:
driver = self.driver.admin_driver(deployment=site_deployment.deployment.name)
driver.delete_tenant(site_deployment.tenant_id)
site_deployment.delete()