| from core.models import Slice, SliceDeployments, User |
| from observer.deleter import Deleter |
| from observer.deleters.slice_deployment_deleter import SliceDeploymentDeleter |
| from util.logger import Logger, logging |
| logger = Logger(level=logging.INFO) |
| class SliceDeleter(Deleter): |
| slice = Slice.objects.get(pk=pk) |
| slice_deployment_deleter = SliceDeploymentDeleter() |
| for slice_deployment in SliceDeployments.objects.filter(slice=slice): |
| slice_deployment_deleter(slice_deployment.id) |
| logger.log_exc("Failed to delete slice_deployment %s" % slice_deployment) |