Bug 42758 - create_ou via python does only create dhcp subnets if interface starts with 'eth'
create_ou via python does only create dhcp subnets if interface starts with '...
Status: REOPENED
Product: UCS@school
Classification: Unclassified
Component: Ucsschool-lib
UCS@school 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-25 11:36 CEST by Florian Best
Modified: 2023-06-12 15:47 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?: 2: Will only affect a 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.069
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 Florian Best univentionstaff 2016-10-25 11:36:39 CEST
I have installed UCS@school together with UVMM. Therefore my interfaces configuration contains a bridge interface:

# ucr dump | grep interfaces
interfaces/br0/address: 10.200.27.117
interfaces/br0/broadcast: 10.200.27.255
interfaces/br0/netmask: 255.255.255.0
interfaces/br0/network: 10.200.27.0
interfaces/br0/options/0: bridge_fd 0
interfaces/br0/options/1: bridge_ports eth0
interfaces/br0/type: static
interfaces/eth0/start: true
interfaces/eth0/type: manual
interfaces/handler: ifplugd

When I create a school via the python lib in a multiserver environment the DHCP Subnets aren't moved/created into the OU.

The code which causes this is:
ucs-school-lib/python/models/dhcp.py
 96 »   »   »   for interface_name in set([key.split('/')[1] for key in ucr.keys() if key.startswith('interfaces/eth')]):

The test case "30_import-create_ou_via_python_api" fails.

We should not operate on UCR directly but use the library instead.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2019-02-05 21:16:22 CET
This issue has been filled against UCS@school 4.1 (R2). The maintenance with bug 
and security fixes for UCS@school 4.1 (R2) has ended on 5th of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3 (or later). 
Please contact your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug"
or simply reopen the issue. In this case please provide detailed information on
how this issue is affecting you.
Comment 2 Florian Best univentionstaff 2023-06-12 15:47:25 CEST
Code is still present exactly the same:

ucs-school-import/usr/share/ucs-school-import/scripts/ucs-school-import:            key.split("/")[1] for key in ucr.keys() if key.startswith("interfaces/eth")
ucs-school-lib/modules/ucsschool/lib/models/dhcp.py:                key.split("/")[1] for key in ucr.keys() if key.startswith("interfaces/eth")