add stub tasks for file system operations

This commit is contained in:
Jan Dittberner 2014-12-25 18:05:42 +01:00
parent e877087127
commit 2428a39f19
2 changed files with 31 additions and 0 deletions

View file

@ -280,6 +280,7 @@ CELERY_RESULT_PERSISTENT = True
CELERY_TASK_RESULT_EXPIRES = None CELERY_TASK_RESULT_EXPIRES = None
CELERY_ROUTES = ( CELERY_ROUTES = (
'osusers.tasks.LdapRouter', 'osusers.tasks.LdapRouter',
'osusers.tasks.FileRouter',
) )
CELERY_ACCEPT_CONTENT = ['yaml'] CELERY_ACCEPT_CONTENT = ['yaml']
CELERY_TASK_SERIALIZER = 'yaml' CELERY_TASK_SERIALIZER = 'yaml'

View file

@ -13,6 +13,16 @@ class LdapRouter(object):
return None 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
@shared_task @shared_task
def create_ldap_group(groupname, gid, descr): def create_ldap_group(groupname, gid, descr):
pass pass
@ -41,3 +51,23 @@ def delete_ldap_user(username):
@shared_task @shared_task
def delete_ldap_group_if_empty(groupname): def delete_ldap_group_if_empty(groupname):
pass pass
@shared_task
def setup_file_sftp_userdir(username):
pass
@shared_task
def delete_file_sftp_userdir(username):
pass
@shared_task
def setup_file_mail_userdir(username):
pass
@shared_task
def delete_file_mail_userdir(username):
pass