move celery routers to gvacommon
This commit is contained in:
parent
92e3212fe1
commit
3bdf634703
3 changed files with 4 additions and 22 deletions
|
@ -1,6 +1,8 @@
|
|||
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
|
||||
|
||||
* :release:`0.1.0 <2014-12-26>`
|
||||
|
|
|
@ -283,8 +283,8 @@ CELERY_RESULT_BACKEND = 'amqp'
|
|||
CELERY_RESULT_PERSISTENT = True
|
||||
CELERY_TASK_RESULT_EXPIRES = None
|
||||
CELERY_ROUTES = (
|
||||
'osusers.tasks.LdapRouter',
|
||||
'osusers.tasks.FileRouter',
|
||||
'gvacommon.celeryrouters.LdapRouter',
|
||||
'gvacommon.celeryrouters.FileRouter',
|
||||
)
|
||||
CELERY_ACCEPT_CONTENT = ['pickle', 'yaml', 'json']
|
||||
CELERY_TASK_SERIALIZER = 'json'
|
||||
|
|
|
@ -25,26 +25,6 @@ SETFACL_CMD = '/usr/bin/setfacl'
|
|||
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):
|
||||
"""
|
||||
Constructs the SFTP directory name for a given username.
|
||||
|
|
Loading…
Reference in a new issue