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

(-)a/services/univention-ldb-modules/modules/univention_samaccountname_ldap_check.c (-3 / +3 lines)
 Lines 282-296   static int univention_samaccountname_ldap_check_add(struct ldb_module *module, s Link Here 
282
		if( ! WIFEXITED(status) ) {
282
		if( ! WIFEXITED(status) ) {
283
			ldb_debug(ldb, LDB_DEBUG_ERROR, "%s: Cannot determine return status of ucs-school-create_windows_computer: %s (%d)\n", ldb_module_get_name(module), strerror(errno_wait), errno_wait);
283
			ldb_debug(ldb, LDB_DEBUG_ERROR, "%s: Cannot determine return status of ucs-school-create_windows_computer: %s (%d)\n", ldb_module_get_name(module), strerror(errno_wait), errno_wait);
284
			return LDB_ERR_UNWILLING_TO_PERFORM;
284
			return LDB_ERR_UNWILLING_TO_PERFORM;
285
		} else if( WEXITSTATUS(status) == 1 ) {
286
			ldb_debug(ldb, LDB_DEBUG_ERROR, "%s: LDB_ERR_ENTRY_ALREADY_EXISTS\n", ldb_module_get_name(module));
287
			return LDB_ERR_ENTRY_ALREADY_EXISTS;
288
		} else if( WEXITSTATUS(status) == 2 ) {
285
		} else if( WEXITSTATUS(status) == 2 ) {
289
			ldb_debug(ldb, LDB_DEBUG_ERROR, ("%s: ldb_add of machine object is disabled\n"), ldb_module_get_name(module));
286
			ldb_debug(ldb, LDB_DEBUG_ERROR, ("%s: ldb_add of machine object is disabled\n"), ldb_module_get_name(module));
290
			return LDB_ERR_UNWILLING_TO_PERFORM;
287
			return LDB_ERR_UNWILLING_TO_PERFORM;
291
		} else if( WEXITSTATUS(status) == 3 ) {
288
		} else if( WEXITSTATUS(status) == 3 ) {
292
			ldb_debug(ldb, LDB_DEBUG_TRACE, ("%s: ldb_add of machine object ignored in dummy mode\n"), ldb_module_get_name(module));
289
			ldb_debug(ldb, LDB_DEBUG_TRACE, ("%s: ldb_add of machine object ignored in dummy mode\n"), ldb_module_get_name(module));
293
			return LDB_SUCCESS;
290
			return LDB_SUCCESS;
291
		} else if( WEXITSTATUS(status) == 4 ) {
292
			ldb_debug(ldb, LDB_DEBUG_ERROR, "%s: LDB_ERR_ENTRY_ALREADY_EXISTS\n", ldb_module_get_name(module));
293
			return LDB_ERR_ENTRY_ALREADY_EXISTS;
294
		} else if( WEXITSTATUS(status) ) {
294
		} else if( WEXITSTATUS(status) ) {
295
			ldb_debug(ldb, LDB_DEBUG_ERROR, ("%s: unknown error code from ucs-school-create_windows_computer: %d\n"), ldb_module_get_name(module), WEXITSTATUS(status));
295
			ldb_debug(ldb, LDB_DEBUG_ERROR, ("%s: unknown error code from ucs-school-create_windows_computer: %d\n"), ldb_module_get_name(module), WEXITSTATUS(status));
296
			return LDB_ERR_UNWILLING_TO_PERFORM;
296
			return LDB_ERR_UNWILLING_TO_PERFORM;
(-)a/services/univention-ldb-modules/ucs-school-create_windows_computer (+3 lines)
 Lines 61-66   def main(): Link Here 
61
	options['school'] = SchoolSearchBase.getOU(ucr.get('ldap/hostdn', '')) or SchoolSearchBase.getOU(ucr.get('dhcpd/ldap/base', ''))
61
	options['school'] = SchoolSearchBase.getOU(ucr.get('ldap/hostdn', '')) or SchoolSearchBase.getOU(ucr.get('dhcpd/ldap/base', ''))
62
	client = Client(args.server, args.username, args.password)
62
	client = Client(args.server, args.username, args.password)
63
	result = client.umc_command(args.command, options).result
63
	result = client.umc_command(args.command, options).result
64
	existed = result.get('existed')
64
	dn_ol = result.get('dn')
65
	dn_ol = result.get('dn')
65
	if not dn_ol:
66
	if not dn_ol:
66
		# sys.exit(1)
67
		# sys.exit(1)
 Lines 71-76   def main(): Link Here 
71
72
72
	dn_s4 = dn_ol[:len(dn_ol) - len(ldap_base)] + samba4_ldap_base
73
	dn_s4 = dn_ol[:len(dn_ol) - len(ldap_base)] + samba4_ldap_base
73
	print dn_s4
74
	print dn_s4
75
	if existed:
76
		sys.exit(4)
74
77
75
78
76
if __name__ == '__main__':
79
if __name__ == '__main__':
(-)a/univention-management-console-module-selective-udm/umc/python/selective-udm/__init__.py (-2 / +8 lines)
 Lines 40-45    Link Here 
40
import univention.admin.modules
40
import univention.admin.modules
41
import univention.admin.objects
41
import univention.admin.objects
42
import univention.admin.uldap
42
import univention.admin.uldap
43
import univention.admin.uexceptions
43
import univention.admin.handlers.users.user
44
import univention.admin.handlers.users.user
44
import univention.admin.handlers.computers.windows
45
import univention.admin.handlers.computers.windows
45
46
 Lines 121-125   def create_windows_computer(self, request, ldap_user_read=None, ldap_admin_write Link Here 
121
			computer['password'] = password
122
			computer['password'] = password
122
123
123
		computer['description'] = request.options.get('description')
124
		computer['description'] = request.options.get('description')
124
		computer_dn = computer.create()
125
		try:
125
		self.finished(request.id, {'dn': computer_dn})
126
			computer_dn = computer.create()
127
			existed = False
128
		except univention.admin.uexceptions.objectExists as exc:
129
			existed = True
130
			computer_dn = exc.args[0]
131
		self.finished(request.id, {'dn': computer_dn, 'existed': existed})

Return to bug 45263