From 2bca6f687f3b52430470dae894f9620292a95ab4 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 29 Jan 2015 18:41:44 +0100 Subject: [PATCH 1/2] reverted Reject handling in ldaptasks --- docs/changelog.rst | 2 ++ gvaldap/ldaptasks/tasks.py | 9 ++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index c1da00d..2cb8821 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,8 @@ Changelog ========= +* :bug:`-` reverted Reject handling in ldaptasks + * release:`0.5.0 <2015-01-29>` * :feature:`-` improved logging of ldaptasks * :support:`-` update bpython to 0.13.2, add explicit dependency on requests diff --git a/gvaldap/ldaptasks/tasks.py b/gvaldap/ldaptasks/tasks.py index cf1a110..f17a7e6 100644 --- a/gvaldap/ldaptasks/tasks.py +++ b/gvaldap/ldaptasks/tasks.py @@ -21,12 +21,6 @@ from ldapentities.models import ( _LOGGER = get_task_logger(__name__) -def log_and_reject(exception, message, *args): - logargs = list(args) + [exception.returncode, exception.output] - _LOGGER.error(message + "\nreturncode: %d\noutput:\n%s", *logargs) - raise Reject(message % args, requeue=False) - - @shared_task def create_ldap_group(groupname, gid, descr): """ @@ -91,7 +85,8 @@ def create_ldap_user(username, uid, gid, gecos, homedir, shell, password): try: ldapgroup = LdapGroup.objects.get(gid=gid) except ObjectDoesNotExist as exc: - log_and_reject(exc, 'LDAP group with gid %d does not exist', gid) + _LOGGER.error('LDAP group with gid %d does not exist', gid) + raise Reject(exc, requeue=False) ldapuser.uid = uid ldapuser.group = gid ldapuser.gecos = gecos From 7e31e8d6718efacdc6fa87640b763c41364577bf Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 29 Jan 2015 18:44:42 +0100 Subject: [PATCH 2/2] update docs version, add release to changelog --- docs/changelog.rst | 3 ++- docs/conf.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 2cb8821..5805c8c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,9 +1,10 @@ Changelog ========= +* :release:`0.5.1 <2015-01-29>` * :bug:`-` reverted Reject handling in ldaptasks -* release:`0.5.0 <2015-01-29>` +* :release:`0.5.0 <2015-01-29>` * :feature:`-` improved logging of ldaptasks * :support:`-` update bpython to 0.13.2, add explicit dependency on requests 2.5.1 diff --git a/docs/conf.py b/docs/conf.py index a6d6b4d..03dd15f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,7 +62,7 @@ copyright = u'2014, 2015 Jan Dittberner' # The short X.Y version. version = '0.5' # The full version, including alpha/beta/rc tags. -release = '0.5.0' +release = '0.5.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.