Univention Bugzilla – Bug 45229
ucs-school-info script throws a traceback displaying network information
Last modified: 2017-10-16 21:33:58 CEST
Created attachment 9127 [details] ldapsearch-ou The ucs-school-info script throws a traceback displaying network information: /usr/sbin/ucs-school-info -n school OU school: ou=school,dc=school,dc=int ------------------------------------- Network: school-10.200.43.0 Network: 10.200.43.0 Netmask: 255.255.255.0 Traceback (most recent call last): File "/usr/sbin/ucs-school-info", line 268, in <module> network(search_base) File "/usr/sbin/ucs-school-info", line 172, in network for subnet in get_objects('dhcp/subnet', base=_base, superordinate=n['dhcpEntryZone']): File "/usr/sbin/ucs-school-info", line 76, in get_objects return univention.admin.modules.lookup(_module, co, lo, superordinate=superordinate, base=base, scope='sub') File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 731, in lookup tmpres = module.lookup(co, lo, filter, base=base, superordinate=superordinate, scope=scope, unique=unique, required=required, timeout=timeout, sizelimit=sizelimit) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/dhcp/__common.py", line 116, in lookup for dn, attrs in lo.search(filter_str, base, scope, [], unique, required, timeout, sizelimit) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 648, in __init__ self._validate_superordinate() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 672, in _validate_superordinate if not set([self.superordinate.module]) & superordinate_names: AttributeError: 'str' object has no attribute 'module' ------------------------------------------------------------------------------ I could reproduce it in my test environment. See attached my two dhcpservices and ldapsearch of the ou.
Created attachment 9128 [details] dhcp-service1
Created attachment 9129 [details] dhcp-service2
Created attachment 9132 [details] patch
ucs-school-info.yaml: afd4fdb673fbcc6d27afa2a408ccfcee43373099 | Merge branch 'fbest/45229-4.2-school-info-superordinate' into 4.2 93d0f9e661961b54199332634a0c5af17557f9ea | YAML Bug #45229 ucs-school-info (7.0.1-1): afd4fdb673fbcc6d27afa2a408ccfcee43373099 | Merge branch 'fbest/45229-4.2-school-info-superordinate' into 4.2 d7a8fb59b9e98a781d3b0921acbace76aa24d479 | Bug #45229: fix ucs-school-info
I was able to reproduce the error if a network has been imported via the "import_networks" script. The new package version fixes this traceback. A small test script has been added, that checks the exitcode of "ucs-school-info -a $OU" for every OU. The test failed with the old version and did not with the new version of ucs-school-info. ucs-test-ucsschool (4.0.4-27): 82621184e1fb | Bug #45229: Merge branch 'sschardt/45229/QA' into 4.2 637bcd7f36b9 | Bug #45229: add changelog entry 64a8f6829ffe | Bug #45229: add very simple test script for ucs-school-info Package: ucs-test-ucsschool Version: 4.0.4-27A~4.2.0.201709131255 Branch: ucs_4.2-0 Scope: ucs-school-4.2
UCS@school 4.2 v4 has been released. http://docs.software-univention.de/changelog-ucsschool-4.2v4-de.html If this error occurs again, please clone this bug.