Bug 51592 - Make univention-lib python3 compatible
Make univention-lib python3 compatible
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: univention-lib
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 4.4-4-errata
Assigned To: Florian Best
Dirk Wiesenthal
:
: 32612 (view as bug list)
Depends on:
Blocks: 51628
  Show dependency treegraph
 
Reported: 2020-06-30 14:42 CEST by Florian Best
Modified: 2020-07-08 15:09 CEST (History)
4 users (show)

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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-06-30 14:42:20 CEST
univention-lib needs to be python 3 compatible.
Comment 1 Florian Best univentionstaff 2020-07-01 19:08:55 CEST
Migrated all necessary functionality to be Python 3 compatible.
univention.lib.{shell,error,ordered_set,urllib2_ssl,getMailFromMailOrUid} are unused, marked as deprecated and not part of the python3-univention-lib package.

univention-lib (8.0.1-33)
36a38a9b127a | Bug #51592: Merge branch 'fbest/51592-univention-lib-python3' into 4.4-4
2889ed20db9f | Bug #51592: add python 3 compatibility
55324305df69 | Bug #51592: use univention-l10n
1a75a9f7b1cf | Bug #51592: univention.lib.package_manager: add python 3 compatibility
be18f376599c | Bug #51592: univention.lib.atjobs: add python 3 compatibility
6844c0ebdf91 | Bug #51592: univention.lib.umc: add python 3 compatibility
792a50752994 | Bug #51592: univention.lib.listenerSharePath: add python 3 compatibility
e99d173d0f52 | Bug #51592: univention.lib.ldap_extension: add python 3 compatibility
a05117242e9c | Bug #51592: univention.lib.license_tools: add python 3 compatibility
b34b4c2a47e4 | Bug #51592: univention.lib.misc: add python 3 compatibility
38c9071ae292 | Bug #51592: univention.lib.shell: add python 3 compatibility
97906b327200 | Bug #51592: univention.lib.fstab: add python 3 compatibility
274bc73795fa | Bug #51592: univention.lib.admember: add python 3 compatibility
eef8a76dd29f | Bug #51592: univention.lib.i18n: add python 3 compatibility
6d8e66485cb3 | Bug #51592: univention.lib.umc: add python3 compatibility
fea9b51f80b2 | Bug #51592: univention.lib.umc_module: add python 3 compatibility
2403853e3201 | Bug #51592: univention.lib.ucs: add python3 compatibility
cfc3f3bd4e22 | Bug #51592: univention.lib.ucsllib2_ssl: import from six
02a0b9ce5938 | Bug #51592: don't install deprecated files in python3-univention-lib
17f724a237ed | Bug #51592: Unify with UCS_Version from univention.updater

univention-lib.yaml
36a38a9b127a | Bug #51592: Merge branch 'fbest/51592-univention-lib-python3' into 4.4-4
2889ed20db9f | Bug #51592: add python 3 compatibility
Comment 2 Florian Best univentionstaff 2020-07-01 19:16:15 CEST
*** Bug 32612 has been marked as a duplicate of this bug. ***
Comment 3 Florian Best univentionstaff 2020-07-01 22:06:23 CEST
ordered_set was implemented for Bug #36480 and might be needed in the future again. See git:4761cf79d6a9a091b10c845bdaf8f09c65683a22. So for python3 it's currently disabled.
Comment 4 Felix Botner univentionstaff 2020-07-02 09:13:14 CEST
Setup is broken currently (see jenkins), not sure if that has something to do with this bug, but please also have look
Comment 5 Felix Botner univentionstaff 2020-07-02 09:22:04 CEST
http://jenkins.knut.univention.de:8080/job/UCS-4.4/job/UCS-4.4-4/job/AutotestJoin/SambaVersion=no-samba,Systemrolle=master/ws/test/autotest-090-master-no-samba.log/*view*/



[master090] 2020-07-01T23:40:31.908478	Traceback (most recent call last):
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/setup/setup_script.py", line 313, in run
[master090] 2020-07-01T23:40:31.908478	    success = self.inner_run()
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/univention-system-setup/scripts/50_software/10software", line 76, in inner_run
[master090] 2020-07-01T23:40:31.908478	    self.autoremove()
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/setup/setup_script.py", line 443, in autoremove
[master090] 2020-07-01T23:40:31.908478	    self.package_manager.autoremove()
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/lib/package_manager.py", line 1111, in autoremove
[master090] 2020-07-01T23:40:31.908478	    return self.commit(msg_if_failed=failed_msg)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/lib/package_manager.py", line 945, in commit
[master090] 2020-07-01T23:40:31.908478	    result = self.cache.commit(**kwargs)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 549, in commit
[master090] 2020-07-01T23:40:31.908478	    res = self.install_archives(pm, install_progress)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 508, in install_archives
[master090] 2020-07-01T23:40:31.908478	    res = install_progress.run(pm)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/apt/progress/base.py", line 208, in run
[master090] 2020-07-01T23:40:31.908478	    res = self.wait_child()
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/apt/progress/base.py", line 279, in wait_child
[master090] 2020-07-01T23:40:31.908478	    self.update_interface()
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/apt/progress/base.py", line 256, in update_interface
[master090] 2020-07-01T23:40:31.908478	    self.status_change(pkgname, float(percent), status_str.strip())
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/lib/package_manager.py", line 349, in status_change
[master090] 2020-07-01T23:40:31.908478	    self.progress_state.percentage(str(percent))
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/lib/package_manager.py", line 143, in percentage
[master090] 2020-07-01T23:40:31.908478	    self.get_logger(logger_name).info(percentage)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/logging/__init__.py", line 1167, in info
[master090] 2020-07-01T23:40:31.908478	    self._log(INFO, msg, args, **kwargs)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/logging/__init__.py", line 1286, in _log
[master090] 2020-07-01T23:40:31.908478	    self.handle(record)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/logging/__init__.py", line 1296, in handle
[master090] 2020-07-01T23:40:31.908478	    self.callHandlers(record)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/logging/__init__.py", line 1336, in callHandlers
[master090] 2020-07-01T23:40:31.908478	    hdlr.handle(record)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/logging/__init__.py", line 759, in handle
[master090] 2020-07-01T23:40:31.908478	    self.emit(record)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/setup/setup_script.py", line 357, in emit
[master090] 2020-07-01T23:40:31.908478	    super(_PackageManagerLoggerHandlerWithoutProcess, self).emit(record)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/lib/package_manager.py", line 403, in emit
[master090] 2020-07-01T23:40:31.908478	    self.step_handler(record.msg)
[master090] 2020-07-01T23:40:31.908478	  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/setup/setup_script.py", line 285, in step
[master090] 2020-07-01T23:40:31.908478	    self._step += 1
[master090] 2020-07-01T23:40:31.908478	TypeError: cannot concatenate 'str' and 'int' objects
[master090] 2020-07-01T23:40:31.908478	 
[master090] 2020-07-01T23:40:32.043522	Exception in thread Thread-1 (most likely raised during interpreter shutdown):
[master090] 2020-07-01T23:40:32.043522	Traceback (most recent call last):
[master090] 2020-07-01T23:40:32.043522	  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
[master090] 2020-07-01T23:40:32.043522	  File "/usr/lib/python2.7/threading.py", line 754, in run
[master090] 2020-07-01T23:40:32.043522	  File "/usr/lib/python2.7/dist-packages/univention/lib/package_manager.py", line 331, in check_pipe
[master090] 2020-07-01T23:40:32.043522	  File "/usr/lib/python2.7/dist-packages/univention/lib/package_manager.py", line 131, in info
[master090] 2020-07-01T23:40:32.043522	  File "/usr/lib/python2.7/dist-packages/univention/lib/package_manager.py", line 120, in get_logger
[master090] 2020-07-01T23:40:32.043522	  File "/usr/lib/python2.7/logging/__init__.py", line 1385, in getChild
[master090] 2020-07-01T23:40:32.043522	  File "/usr/lib/python2.7/logging/__init__.py", line 1037, in getLogger
[master090] 2020-07-01T23:40:32.043522	<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Comment 6 Florian Best univentionstaff 2020-07-02 09:28:21 CEST
Used str() in the wrong place when logging the float percentage.

univention-lib (8.0.1-34)
d18b8af42fad | Bug #51592: fix typo
Comment 7 Felix Botner univentionstaff 2020-07-02 14:07:04 CEST
next problem, installation in ad member mode fails (https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-4/job/Installation%20Tests/mode=ad-member/)

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 359, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 262, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response
    result = _multi_response(self, request)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func
    yield function(self, *args)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/setup/__init__.py", line 766, in check_domain
    ad_domain_info = lookup_adds_dc(nameserver)
  File "/usr/lib/python2.7/dist-packages/univention/lib/admember.py", line 741, in lookup_adds_dc
    ipaddress.ip_addresses(u'%s' % (ad_server,))
AttributeError: 'module' object has no attribute 'ip_addresses'
Comment 8 Florian Best univentionstaff 2020-07-02 15:35:33 CEST
(In reply to Felix Botner from comment #7)

Fixed in:
univention-lib (8.0.1-36)
1553c2e185e9 | Bug #51592: fix typo in admember
Comment 9 Dirk Wiesenthal univentionstaff 2020-07-08 14:34:23 CEST
unittests (technically 5.0): OK
installation files (de.mo, python files that were removed from 5.0 still exist): OK
YAML: OK
VERIFIED
Comment 10 Erik Damrose univentionstaff 2020-07-08 15:09:07 CEST
<http://errata.software-univention.de/ucs/4.4/652.html>