Bug 34940 - Singlemaster: DHCP server object is always moved to new school OU
Singlemaster: DHCP server object is always moved to new school OU
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Wizards
UCS@school 3.2 R2
Other Linux
: P5 normal (vote)
: UCS@school 3.2 R2
Assigned To: Sönke Schwardt-Krummrich
Florian Best
:
Depends on:
Blocks: 34887
  Show dependency treegraph
 
Reported: 2014-05-23 15:04 CEST by Sönke Schwardt-Krummrich
Modified: 2014-06-12 09:20 CEST (History)
0 users

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2014-05-23 15:04:46 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.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2014-05-23 23:33:46 CEST
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
Comment 2 Dirk Wiesenthal univentionstaff 2014-05-26 12:32:36 CEST
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
Comment 3 Dirk Wiesenthal univentionstaff 2014-05-26 12:39:41 CEST
multi_server: create_ou $new_ou $already_used_slave
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2014-05-26 15:09:15 CEST
(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)
Comment 5 Dirk Wiesenthal univentionstaff 2014-05-27 00:50:40 CEST
ucr.is_false('ucsschool/singlemaster', False) -> Always False

Single master:
  ucsschool/singlemaster=yes -> false
Multi server:
  ucsschool/singlemaster unset -> false
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2014-05-27 09:24:25 CEST
(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.
Comment 7 Florian Best univentionstaff 2014-05-27 09:28:06 CEST
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
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2014-06-12 09:19:25 CEST
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".