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

(-)a/management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py (-1 / +1 lines)
 Lines 2050-2056   def __modify_dhcp_object(self, position, mac, ip=None): Link Here 
2050
				univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'the host "%s" already has a dhcp object, so we search for the next free uv name' % (name))
2050
				univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'the host "%s" already has a dhcp object, so we search for the next free uv name' % (name))
2051
				RE = re.compile(r'cn=[^,]+_uv(\d+),')
2051
				RE = re.compile(r'cn=[^,]+_uv(\d+),')
2052
				taken = set(int(m.group(1)) for m in (RE.match(dn) for dn in results) if m)
2052
				taken = set(int(m.group(1)) for m in (RE.match(dn) for dn in results) if m)
2053
				n = min(set(range(max(taken) + 1)) - taken) if taken else 0
2053
				n = min(set(range(max(taken) + 2)) - taken) if taken else 0
2054
				name = '%s_uv%d' % (name, n)
2054
				name = '%s_uv%d' % (name, n)
2055
2055
2056
			dn = 'cn=%s,%s' % (escape_dn_chars(name), position)
2056
			dn = 'cn=%s,%s' % (escape_dn_chars(name), position)

Return to bug 44937