Merge branch 'release/0.1.3' into production

* release/0.1.3:
  update version number
  allow pickle content
  define celery routing
  define CELERY_TASK_SERIALIZER
  change default serializer to json
  make ldap group members field editable
  sync with gvafile
This commit is contained in:
Jan Dittberner 2014-12-26 15:21:04 +01:00
commit 8733d882ed
6 changed files with 33 additions and 7 deletions

View file

@ -1,6 +1,9 @@
Changelog
=========
* :release:`0.1.3 <2014-12-26>`
* :support:`-` add celery routing for file server tasks
* :release:`0.1.2 <2014-12-17>`
* :support:`-` update Django and other dependencies

View file

@ -57,9 +57,9 @@ copyright = u'2014, Jan Dittberner'
# built documents.
#
# The short X.Y version.
version = '0.1.2'
version = '0.1.3'
# The full version, including alpha/beta/rc tags.
release = '0.1.2'
release = '0.1.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View file

@ -5,7 +5,6 @@ Common settings and globals.
"""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
from os import environ
@ -291,6 +290,11 @@ BROKER_URL = get_env_setting('GVALDAP_BROKER_URL')
CELERY_RESULT_BACKEND = 'amqp'
CELERY_RESULT_PERSISTENT = True
CELERY_TASK_RESULT_EXPIRES = None
CELERY_ACCEPT_CONTENT = ['yaml']
CELERY_RESULT_SERIALIZER = 'yaml'
CELERY_ROUTES = (
'osusers.tasks.LdapRouter',
'osusers.tasks.FileRouter',
)
CELERY_ACCEPT_CONTENT = ['pickle', 'yaml', 'json']
CELERY_TASK_SERAILIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
########## END CELERY CONFIGURATION

View file

@ -12,7 +12,6 @@ admin.autodiscover()
urlpatterns = patterns(
'',
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)

View file

@ -19,7 +19,7 @@ class LdapGroupAdmin(admin.ModelAdmin):
entities.
"""
exclude = ['dn', 'members']
exclude = ['dn']
list_display = ['name', 'gid']
search_fields = ['name']

View file

@ -21,6 +21,26 @@ from ldapentities.models import (
_logger = get_task_logger(__name__)
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
@shared_task
def create_ldap_group(groupname, gid, descr):
"""