Bug 44313 - 37_import-networks_via_cli revealed regression in import_networks after superordinate changes
37_import-networks_via_cli revealed regression in import_networks after super...
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.2
Other Linux
: P5 normal (vote)
: UCS@school 4.2 v1
Assigned To: Sönke Schwardt-Krummrich
Daniel Tröder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-06 18:07 CEST by Sönke Schwardt-Krummrich
Modified: 2017-04-18 14:30 CEST (History)
1 user (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?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
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 2017-04-06 18:07:16 CEST
http://jenkins.knut.univention.de:8080/job/UCSschool%204.2/job/UCSschool%204.2%20Singleserver/ImportTests=ImportTests,SambaVersion=s4/27/testReport/junit/90_ucsschool/37_import-networks_via_cli/test/

(2017-04-06 09:14:58.921450) Traceback (most recent call last):
(2017-04-06 09:14:58.921479)   File "/usr/share/ucs-school-import/scripts/import_networks", line 3190, in <module>
(2017-04-06 09:14:58.932061)     import_networks()
(2017-04-06 09:14:58.932119)   File "/usr/share/ucs-school-import/scripts/import_networks", line 2029, in import_networks
(2017-04-06 09:14:58.932414)     success, dn = create_network(schoolNr, network, iprange=iprange, defaultrouter=defaultrouter, nameserver=nameserver, netbiosserver=netbiosserver)
(2017-04-06 09:14:58.932470)   File "/usr/share/ucs-school-import/scripts/import_networks", line 1806, in create_network
(2017-04-06 09:14:58.932740)     set_router_for_subnet(network, defaultrouter, schoolNr)
(2017-04-06 09:14:58.932789)   File "/usr/share/ucs-school-import/scripts/import_networks", line 2219, in set_router_for_subnet
(2017-04-06 09:14:58.933094)     return set_policy_for_dhcp_subnet(network, schoolNr, policy_dhcp_routing_module, dn, values['name'], values=values, overwrite_policy=overwrite_policy)
(2017-04-06 09:14:58.933146)   File "/usr/share/ucs-school-import/scripts/import_networks", line 2122, in set_policy_for_dhcp_subnet
(2017-04-06 09:14:58.933437)     base=baseDN, filter=univention.admin.filter.expression('cn', str(network.network))
(2017-04-06 09:14:58.933484)   File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 743, in lookup
(2017-04-06 09:14:58.962044)     tmpres = module.lookup(co, lo, filter, base=base, superordinate=superordinate, scope=scope, unique=unique, required=required, timeout=timeout, sizelimit=sizelimit)
(2017-04-06 09:14:58.962107)   File "/usr/lib/pymodules/python2.7/univention/admin/handlers/dhcp/__common.py", line 116, in lookup
(2017-04-06 09:14:58.986258)     for dn, attrs in lo.search(filter_str, base, scope, [], unique, required, timeout, sizelimit)
(2017-04-06 09:14:58.986279)   File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 596, in __init__
(2017-04-06 09:14:58.986289)     self._validate_superordinate()
(2017-04-06 09:14:58.986299)   File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 620, in _validate_superordinate
(2017-04-06 09:14:58.986310)     if not set([self.superordinate.module]) & superordinate_names:
(2017-04-06 09:14:58.986318) AttributeError: 'str' object has no attribute 'module'

The import_networks script has not been fully adapted after superordinate changes.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2017-04-06 21:59:31 CEST
By fixing the bugs #34764, #40649 and #42177 (superordinate handling) a regression has been introduced. This has been fixed.

Package: ucs-school-import
Version: 15.0.0-3A~4.2.0.201704062149
Branch: ucs_4.2-0
Scope: ucs-school-4.2

ucs-school-import (15.0.0-3):
r78684 | Bug #44313: fixed import_networks after superordinate changes
Comment 2 Daniel Tröder univentionstaff 2017-04-07 17:25:31 CEST
OK: test works again
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2017-04-11 17:45:44 CEST
UCS@school 4.2 v1 has been released.

http://docs.software-univention.de/release-notes-ucsschool-4.2v1-de.html

If this error occurs again, please clone this bug.
Comment 4 Florian Best univentionstaff 2017-04-18 14:30:03 CEST
The fix missed the DN escaping!!