Univention Bugzilla – Bug 34940
Singlemaster: DHCP server object is always moved to new school OU
Last modified: 2014-06-12 09:20:55 CEST
On a singlemaster while creating a new school OU the DHCP server object of the master is moved to the DHCP container of the new school OU. Since the DHCP server of the single master is searching for objects in the DHCP container of the "first" OU, the DHCP server will be inoperable.
ucs-school-lib and ucs-school-import have been modified so when creating a new OU the DHCP server object is only moved: - in multi server environments - in single server environments if the desired target DHCP server DN matches to the configured DHCPd LDAP search base (UCR dhcpd/ldap/base). The UCR variable will be set upon creating the first OU on a single master system. The DHCP server object is then moved to the DHCP service within the school OU. Creating another OU does not move the DHCP server object because the target DN does not match with the UCR variable (which will remain hopefully untouched). ucs-test-ucschool 1.0.59-1 ucs-school-import 10.0.21-1 ucs-school-lib 5.0.46-1
Traceback (most recent call last): File "/usr/share/ucs-school-import/scripts/create_ou", line 3179, in <module> create_dc(co, lo, baseDN, ouname, dcNameAdministrative, TYPE_DC_ADMINISTRATIVE) File "/usr/lib/python2.6/contextlib.py", line 34, in __exit__ self.gen.throw(type, value, traceback) File "/usr/lib/pymodules/python2.6/ucsschool/lib/models/utils.py", line 171, in stopped_notifier yield File "/usr/share/ucs-school-import/scripts/create_ou", line 3177, in <module> verify_school_ou(ouname, co, lo, baseDN, dcName=dcNameEducational, ShareFileServer=options.ShareFileServer, displayName=options.displayName) File "/usr/share/ucs-school-import/scripts/create_ou", line 791, in verify_school_ou if configRegistry.is_false('ucsschool/singlemaster', False) or (newDHCPServerDN.endswith(',%s' % dhcpd_ldap_base)): UnboundLocalError: local variable 'dhcpd_ldap_base' referenced before assignment
multi_server: create_ou $new_ou $already_used_slave
(In reply to Dirk Wiesenthal from comment #2) > Traceback (most recent call last): […] > UnboundLocalError: local variable 'dhcpd_ldap_base' referenced before > assignment Fixed with ucs-school-import (10.0.21-2)
ucr.is_false('ucsschool/singlemaster', False) -> Always False Single master: ucsschool/singlemaster=yes -> false Multi server: ucsschool/singlemaster unset -> false
(In reply to Dirk Wiesenthal from comment #5) > ucr.is_false('ucsschool/singlemaster', False) -> Always False > > Single master: > ucsschool/singlemaster=yes -> false > Multi server: > ucsschool/singlemaster unset -> false Fixed in ucs-school-lib and ucs-school-import.
Code-Review: OK, no typos. → is_multiserver = not ucr.is_true('ucsschool/singlemaster', False) And to also say it in python: >>> ucr['ucsschool/singlemaster'] = 'true' >>> not ucr.is_true('ucsschool/singlemaster', False) False >>> ucr['ucsschool/singlemaster'] = 'false' >>> not ucr.is_true('ucsschool/singlemaster', False) True >>> del ucr['ucsschool/singlemaster'] >>> not ucr.is_true('ucsschool/singlemaster', False) True
UCS@school 3.2 R2 has been released: http://docs.univention.de/release-notes-ucsschool-3.2R2-de.html If this error occurs again, please use "Clone This Bug".