Index: ad-connector.py =================================================================== --- ad-connector.py (Revision 72821) +++ ad-connector.py (Arbeitskopie) @@ -87,12 +87,14 @@ ob=(dn, new, old, old_dn) - filename=os.path.join(directory,"%f"%time.time()) + tmpdir = os.path.join(directory, 'tmp') + filename = "%f" % time.time() + filepath = os.path.join(tmpdir, filename) - _dump_object_to_file(filename, ob) + _dump_object_to_file(filepath, ob) tmp_array = [] - f=open(filename, 'r') + f=open(filepath, 'r') tmp_array = cPickle.load(f) f.close() @@ -99,10 +101,10 @@ tmp_array_len = len(tmp_array) if tmp_array_len != 4: univention.debug.debug(univention.debug.LDAP, univention.debug.WARN, 'replacing broken cPickle in %s (len=%s) with plain pickle' % (filename, tmp_array_len)) - _dump_object_to_file(filename, ob) + _dump_object_to_file(filepath, ob) tmp_array = [] - f=open(filename, 'r') + f=open(filepath, 'r') tmp_array = cPickle.load(f) f.close() @@ -110,6 +112,8 @@ if tmp_array_len != 4: univention.debug.debug(univention.debug.LDAP, univention.debug.ERROR, 'pickle in %s (len=%s) seems to be broken' % (filename, tmp_array_len)) + os.rename(filepath, os.path.join(directory, filename)) + def handler(dn, new, old, command): global group_objects