|
87 |
|
87 |
|
88 |
ob=(dn, new, old, old_dn) |
88 |
ob=(dn, new, old, old_dn) |
89 |
|
89 |
|
90 |
filename=os.path.join(directory,"%f"%time.time()) |
90 |
tmpdir = os.path.join(directory, 'tmp') |
|
|
91 |
filename = "%f" % time.time() |
92 |
filepath = os.path.join(tmpdir, filename) |
91 |
|
93 |
|
92 |
_dump_object_to_file(filename, ob) |
94 |
_dump_object_to_file(filepath, ob) |
93 |
|
95 |
|
94 |
tmp_array = [] |
96 |
tmp_array = [] |
95 |
f=open(filename, 'r') |
97 |
f=open(filepath, 'r') |
96 |
tmp_array = cPickle.load(f) |
98 |
tmp_array = cPickle.load(f) |
97 |
f.close() |
99 |
f.close() |
98 |
|
100 |
|
|
99 |
tmp_array_len = len(tmp_array) |
101 |
tmp_array_len = len(tmp_array) |
100 |
if tmp_array_len != 4: |
102 |
if tmp_array_len != 4: |
101 |
univention.debug.debug(univention.debug.LDAP, univention.debug.WARN, 'replacing broken cPickle in %s (len=%s) with plain pickle' % (filename, tmp_array_len)) |
103 |
univention.debug.debug(univention.debug.LDAP, univention.debug.WARN, 'replacing broken cPickle in %s (len=%s) with plain pickle' % (filename, tmp_array_len)) |
102 |
_dump_object_to_file(filename, ob) |
104 |
_dump_object_to_file(filepath, ob) |
103 |
|
105 |
|
104 |
tmp_array = [] |
106 |
tmp_array = [] |
105 |
f=open(filename, 'r') |
107 |
f=open(filepath, 'r') |
106 |
tmp_array = cPickle.load(f) |
108 |
tmp_array = cPickle.load(f) |
107 |
f.close() |
109 |
f.close() |
108 |
|
110 |
|
|
110 |
if tmp_array_len != 4: |
112 |
if tmp_array_len != 4: |
111 |
univention.debug.debug(univention.debug.LDAP, univention.debug.ERROR, 'pickle in %s (len=%s) seems to be broken' % (filename, tmp_array_len)) |
113 |
univention.debug.debug(univention.debug.LDAP, univention.debug.ERROR, 'pickle in %s (len=%s) seems to be broken' % (filename, tmp_array_len)) |
112 |
|
114 |
|
|
|
115 |
os.rename(filepath, os.path.join(directory, filename)) |
116 |
|
113 |
def handler(dn, new, old, command): |
117 |
def handler(dn, new, old, command): |
114 |
|
118 |
|
115 |
global group_objects |
119 |
global group_objects |