2014-05-25 23:35:14 +02:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
from celery import shared_task
|
|
|
|
|
|
|
|
|
2014-05-30 17:10:22 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2014-12-25 18:05:42 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2014-05-25 23:35:14 +02:00
|
|
|
@shared_task
|
2014-05-30 18:39:51 +02:00
|
|
|
def create_ldap_group(groupname, gid, descr):
|
|
|
|
pass
|
2014-05-25 23:35:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
2014-05-30 18:39:51 +02:00
|
|
|
def create_ldap_user(username, uid, gid, gecos, homedir, shell, password):
|
|
|
|
pass
|
2014-05-30 17:10:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
def add_ldap_user_to_group(username, groupname):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
|
|
|
def remove_ldap_user_from_group(username, groupname):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
2014-05-30 18:39:51 +02:00
|
|
|
def delete_ldap_user(username):
|
2014-05-30 17:10:22 +02:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
@shared_task
|
2014-05-30 17:18:42 +02:00
|
|
|
def delete_ldap_group_if_empty(groupname):
|
2014-05-30 17:10:22 +02:00
|
|
|
pass
|
2014-12-25 18:05:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
@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
|