Bug 45229 - ucs-school-info script throws a traceback displaying network information
ucs-school-info script throws a traceback displaying network information
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: UCS@school 4.2 v4
Assigned To: Florian Best
Sönke Schwardt-Krummrich
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-21 15:41 CEST by Christina Scheinig
Modified: 2017-10-16 21:33 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.103
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017082121000223
Bug group (optional): Troubleshooting
Max CVSS v3 score:


Attachments
ldapsearch-ou (828 bytes, text/x-ldif)
2017-08-21 15:41 CEST, Christina Scheinig
Details
dhcp-service1 (2.24 KB, text/x-ldif)
2017-08-21 15:41 CEST, Christina Scheinig
Details
dhcp-service2 (2.69 KB, text/x-ldif)
2017-08-21 15:41 CEST, Christina Scheinig
Details
patch (584 bytes, patch)
2017-08-21 16:01 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2017-08-21 15:41:00 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.
Comment 1 Christina Scheinig univentionstaff 2017-08-21 15:41:36 CEST
Created attachment 9128 [details]
dhcp-service1
Comment 2 Christina Scheinig univentionstaff 2017-08-21 15:41:57 CEST
Created attachment 9129 [details]
dhcp-service2
Comment 4 Florian Best univentionstaff 2017-08-21 16:01:30 CEST
Created attachment 9132 [details]
patch
Comment 5 Florian Best univentionstaff 2017-09-08 13:23:09 CEST
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
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2017-09-13 12:57:50 CEST
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
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2017-10-16 21:32:06 CEST
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.