예제 #1
0
파일: models.py 프로젝트: rumale/trove
        def _delete_resources():
            if self.is_building:
                raise exception.UnprocessableEntity("Instance %s is not ready." % self.id)
            LOG.debug("Deleting instance with compute id = %s." % self.db_info.compute_instance_id)

            from trove.cluster.models import is_cluster_deleting

            if self.db_info.cluster_id is not None and not is_cluster_deleting(self.context, self.db_info.cluster_id):
                raise exception.ClusterInstanceOperationNotSupported()

            self.update_db(task_status=InstanceTasks.DELETING, configuration_id=None)
            task_api.API(self.context).delete_instance(self.id)
예제 #2
0
파일: models.py 프로젝트: vdialani/trove
        def _delete_resources():
            if self.is_building:
                raise exception.UnprocessableEntity("Instance %s is not ready."
                                                    % self.id)
            LOG.debug("Deleting instance with compute id = %s." %
                      self.db_info.compute_instance_id)

            from trove.cluster.models import is_cluster_deleting
            if (self.db_info.cluster_id is not None and not
               is_cluster_deleting(self.context, self.db_info.cluster_id)):
                raise exception.ClusterInstanceOperationNotSupported()

            self.update_db(task_status=InstanceTasks.DELETING,
                           configuration_id=None)
            task_api.API(self.context).delete_instance(self.id)
예제 #3
0
파일: models.py 프로젝트: zjtheone/trove
        def _delete_resources():
            if self.is_building:
                raise exception.UnprocessableEntity("Instance %s is not ready." % self.id)
            LOG.debug("Deleting instance with compute id = %s.", self.db_info.compute_instance_id)

            from trove.cluster.models import is_cluster_deleting

            if self.db_info.cluster_id is not None and not is_cluster_deleting(self.context, self.db_info.cluster_id):
                raise exception.ClusterInstanceOperationNotSupported()

            if self.slaves:
                msg = _("Detach replicas before deleting replica source.")
                LOG.warning(msg)
                raise exception.ReplicaSourceDeleteForbidden(msg)

            self.update_db(task_status=InstanceTasks.DELETING, configuration_id=None)
            task_api.API(self.context).delete_instance(self.id)