View | Details | Raw Unified | Return to bug 25404
Collapse All | Expand All

(-)a/branches/ucs-4.1/ucs-4.1-3/management/univention-directory-logger/directory_logger.py (-4 / +9 lines)
 Lines 211-218   def handler(dn, new, old): Link Here 
211
211
212
		# 2. generate log record
212
		# 2. generate log record
213
		if new_copy:
213
		if new_copy:
214
			modifier = new_copy['modifiersName'][0]
214
			try:
215
			timestamp = ldapTime2string( new_copy['modifyTimestamp'][0] )
215
				modifier = new_copy['modifiersName'][0]
216
			except LookupError:
217
				modifier = '<unknown>'
218
			try:
219
				timestamp = ldapTime2string(new_copy['modifyTimestamp'][0])
220
			except LookupError:
221
				timestamp = '<unknown>'
216
222
217
			if not old_copy:	# create branch
223
			if not old_copy:	# create branch
218
				record = headerfmt % (previoushash, dn, id, modifier, timestamp, 'add')
224
				record = headerfmt % (previoushash, dn, id, modifier, timestamp, 'add')
 Lines 279-286   def createFile(filename, withdirs=False ): Link Here 
279
	if not os.path.exists( basedir ):
285
	if not os.path.exists( basedir ):
280
		os.makedirs( basedir )
286
		os.makedirs( basedir )
281
287
282
	returncode = subprocess.call(["/bin/touch", "%s" % filename ])
288
	if subprocess.call(["/bin/touch", filename ]) or not os.path.exists(filename):
283
	if not os.path.exists( filename ):
284
		univention.debug.debug(univention.debug.LISTENER, univention.debug.ERROR, '%s: %s could not be created.' % (name, filename) )
289
		univention.debug.debug(univention.debug.LISTENER, univention.debug.ERROR, '%s: %s could not be created.' % (name, filename) )
285
		return 1
290
		return 1
286
	os.chown(filename, uidNumber, gidNumber)
291
	os.chown(filename, uidNumber, gidNumber)

Return to bug 25404