Bug 51318 - base/univention-system-setup: migrate to python3
base/univention-system-setup: migrate to python3
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0-1-errata
Assigned To: Florian Best
Philipp Hahn
https://git.knut.univention.de/univen...
: python3-migration
Depends on:
Blocks: 55156
  Show dependency treegraph
 
Reported: 2020-05-19 14:31 CEST by Florian Best
Modified: 2022-09-01 09:55 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
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:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-05-19 14:31:27 CEST
The UMC module of base/univention-system-setup has to be python3-compatible.
Comment 1 Florian Best univentionstaff 2021-03-24 19:24:36 CET
We should replace `obj.info[property] = value` with `obj[property] = value`. Otherwise syntax checks, etc. aren't done.

base/univention-system-setup/umc/python/setup/netconf/modules/LdapDhcp.py:                      subnet.info["subnet"] = str(ipv4.network)                                                                                                     
base/univention-system-setup/umc/python/setup/netconf/modules/LdapDhcp.py:                      subnet.info["subnetmask"] = str(ipv4.prefixlen)                                                                                               
base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py:           network.info["name"] = "default"                                                                                                                      
base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py:           network.info["network"] = str(ipv4.network)                                                                                                           
base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py:           network.info["netmask"] = str(ipv4.netmask)                                                                                                           
base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py:                   network.info["dnsEntryZoneForward"] = forward_zone                                                                                            
base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py:                   network.info["dnsEntryZoneReverse"] = reverse_zone                                                                                            
base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py:                   network.info["dhcpEntryZone"] = dhcp_service                                                                                                  
base/univention-system-setup/umc/python/setup/netconf/modules/LdapReferences.py:                        obj.info[udm_property] = new_values                                                                                                   
base/univention-system-setup/umc/python/setup/netconf/modules/LdapSSO.py:                       obj.info["a"] = list(new_values)                                                                                                              
base/univention-system-setup/umc/python/setup/netconf/modules/LdapSamba.py:                     obj.info["a"] = list(new_values)                                                                                                              
base/univention-system-setup/umc/python/setup/netconf/modules/LdapSelf.py:              computer.info["ip"] = list(set(all_addr))                                                                                                             
base/univention-system-setup/umc/python/setup/netconf/modules/LdapSelf.py:              computer.info["dnsEntryZoneReverse"] = [                                                                                                              
base/univention-system-setup/umc/python/setup/netconf/modules/LdapSelf.py:              computer.info["mac"] = list(macs)
Comment 3 Florian Best univentionstaff 2021-09-20 14:57:39 CEST
Patch available in git:fbest/51318-python3-univention-system-setup
Comment 4 Florian Best univentionstaff 2022-03-25 18:17:22 CET
Univention System Setup has been migrated to Python 3.
I did functional test of every UMC module.
I did basic functional tests of the DVD by installing a DC master role.
comment 1 has been respected as well.

univention-system-setup.yaml
75842f616365 | Bug #51318: migrate univention-system-setup to Python 3

univention-system-setup (13.0.3-36)
75842f616365 | Bug #51318: migrate univention-system-setup to Python 3
58e334109215 | Bug #51318: remove UCRv system/setup/boot/legacyfrontend
dafb09bf90ab | Bug #51318: replace python with dash
e88d93fe8620 | Bug #51318: [univention-system-setup]: apply isort
e9ba24071a08 | Bug #51318: [univention-system-setup]: use ip instead of ifconfig
66cc245bc479 | Bug #51318: [univention-system-setup]: fix UDM usage
75804fe09fd9 | Bug #51318: [univention-system-setup]: migrate to Python 3

OLD changes:
univention-system-setup (13.0.0-1)
2bd09f9e2356 | Bug #51318 USS: Python 3: with_metaclass
112329dfb94e | Bug #51318 USS: migrate ipaddr → ipaddress
59dfbe7ef7c8 | Bug #51318 USS: Convert __cmp__ to rich comparison

univention-system-setup (12.0.2-26)
c8cad1727625 | Bug #51318 USS: Add unit test for comparison
Comment 5 Florian Best univentionstaff 2022-04-20 13:32:40 CEST
Some more changes:

univention-system-setup (13.0.3-36)
5b8c1d43db55 | fixup! fixup! Bug #51318: [univention-system-setup]: use ip instead of ifconfig
98c181100c0f | fixup! Bug #51318: [univention-system-setup]: use ip instead of ifconfig
b4d1806caf37 | Revert "Bug #51318: temporarily execute UMC module with Python 2 again"
649dd20b492b | Bug #51318: readd Python 2.7 compatibility
cc3e711effff | Bug #51318: add missing dependency
71477963ce4d | Bug #51318: temporarily execute UMC module with Python 2 again
6e31fa1d7622 | Bug #51318: [univention-system-setup]: decode() subprocess output
8ae3b4dea318 | fixup! Bug #51318: [univention-system-setup]: migrate to Python 3
dd1a2a28bfc3 | refactor[uss]: Use argument parser
Comment 6 Philipp Hahn univentionstaff 2022-04-28 16:52:44 CEST
OK: apt install univention-system-setup -t apt
OK: dpkg-query -W univention-system-setup # 13.0.3-36A~5.0.0.202204211120
OK: change IPv4
OK: add IPv6
OK: git log --grep Bug\ \#51318 origin/5.0-0..5.0-1
OK: https://univention-dist-jenkins.k8s.knut.univention.de/job/UCS-5.0/job/UCS-5.0-1/job/Installation%20Tests/mode=master-german/58/console
OK: isotests/ucs_5.0-1-latest-amd64.iso
OK: univention-system-setup.yaml
OK: errata-announce  -V --only univention-system-setup.yaml
FYI: https://www.kernel.org/doc/html/latest/networking/alias.html
Comment 7 Florian Best univentionstaff 2022-05-02 11:19:30 CEST
Forgot to add the discussed removal of Python 2 support:

Done in:

univention-system-setup (13.0.3-36)
4e02924e0190 | Bug #51318: [univention-system-setup]: drop Python 2 packages/dependencies
Comment 8 Philipp Hahn univentionstaff 2022-05-04 14:08:51 CEST
OK: git:4e02924e0190
OK: errata-announce  -V --only univention-system-setup.yaml
OK: apt install univention-system-setup -t apt
OK: dpkg-query -W univention-system-setup # 13.0.3-36A~5.0.0.202205021118
OK: libpython2.7 python-ipaddr python-lxml python-univention-ipcalc
OK: gpi lxml
OK: gpi ipaddr
OK: gpi univention.ipcalc
OK: change IPv4
OK: add IPv6
OK: https://univention-dist-jenkins.k8s.knut.univention.de/job/UCS-5.0/job/UCS-5.0-1/job/Installation%20Tests/mode=master-german/lastBuild/console