Univention Bugzilla – Bug 47966
Add functions to univention.lib to query types of given computer objects
Last modified: 2018-11-16 11:48:12 CET
Within the samba packages some functions are required to determine if a given computer object is a "central computer" or if it is related to a specific school.
Added a new python module ucsschool.lib.info: MembershipFlags = namedtuple('MembershipFlags', ['is_edu_school_member', 'is_admin_school_member']) def get_school_membership_type(lo, dn): # type: (univention.uldap.Access, str) -> MembershipFlags def is_central_computer(lo, dn): # type: (univention.uldap.Access, str) -> bool def is_school_slave(lo, dn): # type: (univention.uldap.Access, str) -> bool A new ucs-test script 90_ucsschool/400_ucsschool_lib_info has been added, that checks the API with different computer objects. d52c92bfc Bug #47966: bump version 916e879da Bug #47966: test exception if no slave DN has been passed to is_school_slave() e756462b6 Bug #47966: add missing mypy annotation 7bf5a2d80 Bug #47966: update advisory de32431d1 Bug #47966: add changelog entry 50928201c Bug #47966: add 400_ucsschool_lib_info 3f4f31a4e Bug #47966: add advisory 5f31a2185 Bug #47966: add changelog entry 470fd9977 Bug #47966: add simple interface to check school membership of computers Package: ucs-school-lib Version: 11.0.1-28A~4.3.0.201811051422 Branch: ucs_4.3-0 Scope: ucs-school-4.3 Package: ucs-test-ucsschool Version: 5.0.2-100A~4.3.0.201811061053 Branch: ucs_4.3-0 Scope: ucs-school-4.3
If I read get_school_membership_type() correctly, it is enough to be in either cn=DC-Edukativnetz or cn=OU$OU-DC-Edukativnetz to be counted as a edu school server. Is that intended? If that should not be the case, I suggest to a) create a system diagnose module to warn about such "broken" school objects and b) the code testing for cn=OU$OU-DC-Edukativnetz would not be required.
(In reply to Daniel Tröder from comment #2) > If I read get_school_membership_type() correctly, it is enough to be in > either cn=DC-Edukativnetz or cn=OU$OU-DC-Edukativnetz to be counted as a edu > school server. Is that intended? > > If that should not be the case, I suggest to a) create a system diagnose > module to warn about such "broken" school objects and b) the code testing > for cn=OU$OU-DC-Edukativnetz would not be required. a) I created a draft for am diagnostic module. I think we will add the module to UCS@school via a seperate bug. b) I would like to keep the code there for safety now. But you are right, if we assure that global and OU-specific group memberships are consistent, the ou-specific test is no longer required. bc4fe3824 Bug #47966: fixed mypy annotations and doc strings
OK: code OK: manual test OK: automatic test OK: advisory
UCS@school 4.3 v6 has been released. https://docs.software-univention.de/changelog-ucsschool-4.3v6-de.html If this error occurs again, please clone this bug.