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

(-)ucs/management/univention-directory-manager-modules/univention-dnsedit (-6 / +10 lines)
 Lines 209-224    Link Here 
209
	if records:
209
	if records:
210
		record = records[0]
210
		record = records[0]
211
	else:
211
	else:
212
		record = srv_record.object(co, lo, position, superordinate=zone)
212
		print >> sys.stderr, "No record found"
213
		record['name'] = name
213
		return
214
214
215
	loc = record['location']
215
	loc = record['location']
216
	if location in loc:
216
	if location in loc:
217
		loc.remove(location)
217
		loc.remove(location)
218
		record['location'] = loc
218
		if loc:
219
219
			record.modify()
220
	if records:
220
		else:
221
		record.modify()
221
			record.remove()
222
	else:
223
		print >> sys.stderr, "Does not exist"
222
224
223
225
224
def add_txt_record(name, text):
226
def add_txt_record(name, text):
 Lines 385-395    Link Here 
385
	except univention.admin.uexceptions.objectExists, ex:
387
	except univention.admin.uexceptions.objectExists, ex:
386
		if not options.ignore_exists:
388
		if not options.ignore_exists:
387
			print >> sys.stderr, 'E: Object "%s" exists' % (ex,)
389
			print >> sys.stderr, 'E: Object "%s" exists' % (ex,)
390
			raise
388
			sys.exit(1)
391
			sys.exit(1)
389
	except (ValueError, TypeError,
392
	except (ValueError, TypeError,
390
			univention.admin.uexceptions.valueInvalidSyntax,
393
			univention.admin.uexceptions.valueInvalidSyntax,
391
			univention.admin.uexceptions.valueRequired), ex:
394
			univention.admin.uexceptions.valueRequired), ex:
392
		print >> sys.stderr, 'E: failed %s' % (ex,)
395
		print >> sys.stderr, 'E: failed %s' % (ex,)
396
		raise
393
		sys.exit(1)
397
		sys.exit(1)
394
398
395
399

Return to bug 28794