From dd2edc3fcb6ef9ddf0357847bebaa0c2d4315376 Mon Sep 17 00:00:00 2001 From: Florian Brucker Date: Mon, 18 Jul 2016 10:48:21 +0200 Subject: [PATCH] [#2977] Mark Celery features as deprecated. --- ckan/lib/celery_app.py | 8 ++++++++ ckan/lib/cli.py | 5 +++++ ckan/logic/action/get.py | 2 ++ 3 files changed, 15 insertions(+) diff --git a/ckan/lib/celery_app.py b/ckan/lib/celery_app.py index 9f66e85f33b..047acfa1f01 100644 --- a/ckan/lib/celery_app.py +++ b/ckan/lib/celery_app.py @@ -1,5 +1,11 @@ # encoding: utf-8 +''' +Celery background tasks management. + +This module is DEPRECATED, use ``ckan.lib.jobs`` instead. +''' + import ConfigParser import os import logging @@ -9,6 +15,8 @@ log = logging.getLogger(__name__) +log.warning('ckan.lib.celery_app is deprecated, use ckan.lib.jobs instead.') + LIST_PARAMS = """CELERY_IMPORTS ADMINS ROUTES""".split() from celery import Celery diff --git a/ckan/lib/cli.py b/ckan/lib/cli.py index b25eded4af1..97a59cf537b 100644 --- a/ckan/lib/cli.py +++ b/ckan/lib/cli.py @@ -946,6 +946,8 @@ def purge(self, dataset_ref): class Celery(CkanCommand): '''Celery daemon + This command is DEPRECATED, use `paster jobs` instead. + Usage: celeryd - run the celery daemon celeryd run concurrency - run the celery daemon with @@ -973,6 +975,7 @@ def command(self): error('Command %s not recognized' % cmd) def run_(self): + deprecation_warning(u'Use `paster jobs worker` instead.') default_ini = os.path.join(os.getcwd(), 'development.ini') if self.options.config: @@ -989,6 +992,7 @@ def run_(self): celery.worker_main(argv=['celeryd', '--loglevel=INFO'] + celery_args) def view(self): + deprecation_warning(u'Use `paster jobs list` instead.') self._load_config() import ckan.model as model from kombu.transport.sqlalchemy.models import Message @@ -1003,6 +1007,7 @@ def view(self): print '%i: Invisible Sent:%s' % (message.id, message.sent_at) def clean(self): + deprecation_warning(u'Use `paster jobs clear` instead.') self._load_config() import ckan.model as model query = model.Session.execute("select * from kombu_message") diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py index 65244fc54aa..200b71a69bd 100644 --- a/ckan/logic/action/get.py +++ b/ckan/logic/action/get.py @@ -1114,6 +1114,8 @@ def resource_view_list(context, data_dict): def resource_status_show(context, data_dict): '''Return the statuses of a resource's tasks. + This function is DEPRECATED. + :param id: the id of the resource :type id: string