Bug 985321

Summary: iscsi-initiator-utils Python 3 compatibility
Product: [Fedora] Fedora Reporter: Bohuslav "Slavek" Kabrda <bkabrda>
Component: iscsi-initiator-utilsAssignee: Chris Leech <cleech>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: a.badger, agrover, cleech, hdegoede, mhroncok, rkuska
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iscsi-initiator-utils-6.2.0.873-25.gitc9d830b.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-15 17:19:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1014220    
Attachments:
Description Flags
iscsi-initiator-utils Python 3 compat patch none

Description Bohuslav "Slavek" Kabrda 2013-07-17 09:50:46 UTC
Hi,
is there any plan/estimate of making iscsi-initiator-utils compatible with Python 3? I'm currently trying to figure out what it'd take to move Fedora to Python 3 and since iscsi-initiator-utils is one of Anaconda's deps, it'd need to be converted as one of the first.
Thanks.

Comment 1 Fedora End Of Life 2013-09-16 14:34:34 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 2 Miro Hrončok 2013-10-01 14:27:51 UTC
If you need any extra hand with this, feel free to use me :)

Comment 3 Miro Hrončok 2013-10-02 11:34:16 UTC
Hi, we would like to use Python 3 on the default installation instead of Python 2 on Fedora 22.

From that perspective, your package is considered as IMPORTANT - that means, is has to be updated to Python 3, for our intention come true.

The goal here is, that this package uses Python 3 as default in Fedora 22.

Please, help use update to Python 3 flawlessly.

Check if upstream already support Python 3, if yes, use it and add te support to the package.

If upstream doesn't support Python 3 yet, encourage it to do so by sending patches and offering your help.

When upstream is dead or unwilling to support Python 3, you'll need to patch this package on Fedora level. Try to avoid this as much as you can, but use it, if it's the last option.

Chances are, that you ARE the upstream. In that case, everything is easier, just do it yourself.

Once Python 3 is supported, check your package, if it works with it. Don't switch to Python 3 yet as a default (that's still against the guidelines). I recommend to prepare your spec and conditionalize the thing with something like %global default_python 2/3.

There is a table on wiki, that should list your package. Chances are, that you can see an upstream link that covers the problem. Anyway, please update the table with information you know.

https://fedoraproject.org/wiki/User:Churchyard/python3

I offer my help with this task, so if you have no idea, how to work on this, or it is just not your priority, don't hesitate to ask for help.

(As you've already realized, this is a bulk text, so if something is not quite exact about your package, sorry for that, just ask)

Comment 4 Toshio Ernie Kuratomi 2013-10-02 22:02:21 UTC
Note: do not follow this advice as it is against the Packaging Guidelines: "When upstream is dead or unwilling to support Python 3, you'll need to patch this package on Fedora level. Try to avoid this as much as you can, but use it, if it's the last option."

If you are in this situation, you'll essentially be forking upstream in order to produce a python3 port.  In that situation, the proper thing to do is to create a new package with the python3 port.  It would be even better to create the proper upstream infrastructure as well (new upstream scm and issue tracker) but that isn't 100% required by the guidelines.

Comment 5 Bohuslav "Slavek" Kabrda 2015-01-21 17:09:42 UTC
Created attachment 982455 [details]
iscsi-initiator-utils Python 3 compat patch

I'm attaching a patch that makes iscsi-initiator-utils Python bindings compatible with Python 3, while maintaining Python >= 2.6 compatibility.
Note that it renames the Python bindings file libiscscimodule.so to libiscsi.so, since in Python 3, the "module" suffix is no longer recognized (but "import libiscsi" still works even in Python >= 2.6).

Comment 6 Bohuslav "Slavek" Kabrda 2015-01-21 17:13:27 UTC
Chris, can you please review the patch and possibly accept it? This is now blocking Anaconda's migration to Python 3.

Note: I think it'd be best to create python-libiscsi and python3-libiscsi subpackages that would ship bindings for the respective Python interpreters (so not shipping the Python extension files in the main package). This way the main package won't depend on Python and depending packages will be able to port easily, since they'll have both bindings installable in parallel (and will be able to choose.

Let me know if you need help.
Thanks!

Comment 7 Chris Leech 2015-01-28 21:22:53 UTC
(In reply to Bohuslav "Slavek" Kabrda from comment #6)
> Chris, can you please review the patch and possibly accept it? This is now
> blocking Anaconda's migration to Python 3.
> 
> Note: I think it'd be best to create python-libiscsi and python3-libiscsi
> subpackages that would ship bindings for the respective Python interpreters
> (so not shipping the Python extension files in the main package). This way
> the main package won't depend on Python and depending packages will be able
> to port easily, since they'll have both bindings installable in parallel
> (and will be able to choose.
> 
> Let me know if you need help.
> Thanks!

Thanks for the patch, I have this built in rawhide.

As for splitting out python2/3 bindings into subpackages, I like the idea but didn't do it for this build.  Although it looks like blivet might be the only thing using these directly now, so fixing dependencies if they get split out shouldn't be too bad.

Comment 8 Jaroslav Reznik 2015-03-03 17:09:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 9 Robert Kuska 2015-07-03 07:27:36 UTC
There is an python3 subpackage in the lastest build of the iscsi-initiator-utils.

Can this be closed?

Comment 10 Miro Hrončok 2015-07-14 11:31:09 UTC
Chris?