blob: fa97be22753c7dcb013042c7550343d0f98277f7 [file] [log] [blame]
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04001from core.models import Site, SiteDeployments
2from observer.deleter import Deleter
3
4class SiteDeploymentDeleter(Deleter):
5 model='SiteDeployments'
6
7 def call(self, pk):
8 site_deployment = SiteDeployments.objects.get(pk=pk)
9 if site_deployment.tenant_id:
10 driver = self.driver.admin_driver(deployment=site_deployment.deployment.name)
11 driver.delete_tenant(site_deployment.tenant_id)
12 site_deployment.delete()