#566 allow profiles to request a specific python version
Merged 2 years ago by mikem. Opened 2 years ago by mikem.
mikem/koji cli-pyver-config  into  master

No commits found

Currently in Fedora, the Koji cli runs under python3. However some Koji features are not available in py3 (e.g. krb auth). This change allows users to set pyver=2 in their profile, which causes the script to rerun itself under the requested python version as soon as the information is available.

@breilly, can you also review this?

tested on my f24 and rhel6 vm

For more info, suggest to change this lime to:

        logger.error('No such file: %s, fall back to default exec: %s', py_exec, sys.executable)

can't we have some downstream patch in fedora? I don't like such hacks at all...

can't we have some downstream patch in fedora? I don't like such hacks at all...

Fedora does not want Koji to require python2, so that it can be included in a py3-only base install.

I admit this patch has an odd feel to it, but I'm not quite sure I'd call it a hack. How else can a single koji executable selectively run under either python2 or 3 depending on profile?

The only other way would be to have multiple executables, but this requires users to change the command they run, which is not always an option (e.g. if koji is being run by another tool for you).

I am open to counter-proposals

how about alternatives here

how about alternatives here

hmm, I guess that could work....

granted, using alternatives is kind of a red flag

Given that this is causing problems for some folks, I'm going to go ahead and merge this workaround for 1.14. It may not be the best possible solution, but it works and is has no effect if it is not configured.

We can look into the alternatives approach later.

Commit 345dc57 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

2 years ago