Bug 51996 - Migration univention-appcenter-control script to Python 3
Migration univention-appcenter-control script to Python 3
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center - Self Service
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Florian Best
Dirk Wiesenthal
https://git.knut.univention.de/univen...
: python3-migration
Depends on: 49060
Blocks:
  Show dependency treegraph
 
Reported: 2020-09-11 11:44 CEST by Nico Gulden
Modified: 2022-10-06 22:56 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.011
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
Result after running 2-to-3 (1.11 KB, patch)
2020-09-11 11:46 CEST, Nico Gulden
Details | Diff
patch (3.02 KB, patch)
2022-05-09 21:04 CEST, Florian Best
Details | Diff
patch (with argparse --required=True for subparsers) (3.64 KB, patch)
2022-05-09 21:28 CEST, Florian Best
Details | Diff
Replace UMC Auth with HTTP basic auth (2.35 KB, patch)
2022-05-09 21:36 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Gulden univentionstaff 2020-09-11 11:44:50 CEST
App developers can use the `univention-appcenter-control` script to interact with the App Provider Portal via an upload interface, see https://docs.software-univention.de/app-provider.html#upload-interface

The script is written in Python 2 and should be migrated to Python 3.
Comment 1 Nico Gulden univentionstaff 2020-09-11 11:46:24 CEST
Created attachment 10487 [details]
Result after running 2-to-3

It could be an easy fix. I just ran `2-to-3` on the script and the patch is very small. But I cannot tell, what else may need to be considered.
Comment 2 Florian Best univentionstaff 2020-09-11 12:09:35 CEST
Please use six.with_metaclass() and from six.moves import input().
Comment 3 Dirk Wiesenthal univentionstaff 2020-09-11 12:16:18 CEST
(In reply to Florian Best from comment #2)
> Please use six.with_metaclass() and from six.moves import input().

Please do not do that. The script runs on the laptop of any App Provider. They may not have six installed.

Also, there is no need to support Python 2 and 3 at the same time.
Comment 4 Florian Best univentionstaff 2021-03-09 22:36:54 CET
Is this necessary for UCS 5.0?
Comment 5 Nico Gulden univentionstaff 2021-03-22 11:56:24 CET
An app developer complained about the script being Python 2. It's the only script on the system where Python 2 is needed.
Comment 7 Florian Best univentionstaff 2022-05-09 21:04:52 CEST
Created attachment 10947 [details]
patch
Comment 8 Florian Best univentionstaff 2022-05-09 21:28:08 CEST
Created attachment 10948 [details]
patch (with argparse --required=True for subparsers)
Comment 9 Florian Best univentionstaff 2022-05-09 21:36:20 CEST
Created attachment 10949 [details]
Replace UMC Auth with HTTP basic auth

On top of the patch another patch to use basic HTTP auth which improves speed by re-using opened module processes.
Comment 11 Florian Best univentionstaff 2022-10-04 14:41:09 CEST
e50b068586d7 | Bug #51996: use HTTP basic auth
e19f7874b449 | Bug #51996: migrate univention-appcenter-control to Python 3
Comment 12 Dirk Wiesenthal univentionstaff 2022-10-06 22:56:34 CEST
Script now works with python3 (only)