Example #1
0
        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)
Example #2
0
        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)
Example #3
0
        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)