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