move celery routers to gvacommon

This commit is contained in:
Jan Dittberner 2014-12-27 13:59:38 +01:00
parent 92e3212fe1
commit 3bdf634703
3 changed files with 4 additions and 22 deletions

View file

@ -1,6 +1,8 @@
Changelog Changelog
========= =========
* :support:`-` move celery routers into gvacommon that is in it's own
repository to be used by others (gva, gvaldap)
* :bug:`-` sftp directories are now owned by root instead of user * :bug:`-` sftp directories are now owned by root instead of user
* :release:`0.1.0 <2014-12-26>` * :release:`0.1.0 <2014-12-26>`

View file

@ -283,8 +283,8 @@ CELERY_RESULT_BACKEND = 'amqp'
CELERY_RESULT_PERSISTENT = True CELERY_RESULT_PERSISTENT = True
CELERY_TASK_RESULT_EXPIRES = None CELERY_TASK_RESULT_EXPIRES = None
CELERY_ROUTES = ( CELERY_ROUTES = (
'osusers.tasks.LdapRouter', 'gvacommon.celeryrouters.LdapRouter',
'osusers.tasks.FileRouter', 'gvacommon.celeryrouters.FileRouter',
) )
CELERY_ACCEPT_CONTENT = ['pickle', 'yaml', 'json'] CELERY_ACCEPT_CONTENT = ['pickle', 'yaml', 'json']
CELERY_TASK_SERIALIZER = 'json' CELERY_TASK_SERIALIZER = 'json'

View file

@ -25,26 +25,6 @@ SETFACL_CMD = '/usr/bin/setfacl'
RM_CMD = '/bin/rm' RM_CMD = '/bin/rm'
class LdapRouter(object):
def route_for_task(self, task, args=None, kwargs=None):
if 'ldap' in task:
return {'exchange': 'ldap',
'exchange_type': 'direct',
'queue': 'ldap'}
return None
class FileRouter(object):
def route_for_task(self, task, args=None, kwargs=None):
if 'file' in task:
return {'exchange': 'file',
'exchange_type': 'direct',
'queue': 'file'}
return None
def _build_sftp_directory_name(username): def _build_sftp_directory_name(username):
""" """
Constructs the SFTP directory name for a given username. Constructs the SFTP directory name for a given username.