linsomniac / drbdlinks

A helper for DRBD which makes/reverts links into DRBD volumes.
GNU General Public License v2.0
8 stars 5 forks source link

Python 3 support? #8

Closed robert-scheck closed 5 years ago

robert-scheck commented 5 years ago

Python 2.7 will not be maintained past 2020, so drbdlinks should support Python 3…and if it does, it should be reflected in the documentation.

linsomniac commented 5 years ago

I've merged this pull request and made some changes to clean some things up. I also changed how the --scontext detection works, could you run a test of this version and verify it works? I don't have an SELinux box available to me. Thanks for the patch!

robert-scheck commented 5 years ago

When just looking to the diff: Doing ls --scontext in an arbitrary directory (from which drbdlinks is being called) will lead to various "strange" SELinux AVC denied messages depending on the arbitrary sub-directories or files in that directory, that's why I passed in drbdlinks itself.

I'll try to fire some tests tonight and will let you know about the results regarding the other changes.

linsomniac commented 5 years ago

That was an oversight, I meant to pass dunder-file in. Changed and pushed, thanks!

robert-scheck commented 5 years ago

Thank you!

Without #8, RHEL/CentOS 6 (reaches EOL in 11/2020) fails as follows:

$ drbdlinks status
Traceback (most recent call last):
  File "/usr/sbin/drbdlinks", line 361, in <module>
    config = loadConfigFile(configFile)
  File "/usr/sbin/drbdlinks", line 191, in loadConfigFile
    config = configClass()
  File "/usr/sbin/drbdlinks", line 158, in __init__
    subprocess.check_output(
AttributeError: 'module' object has no attribute 'check_output'
$ 
linsomniac commented 5 years ago

Great, thanks for checking that and the patch to fix it.

Does it look good to you as it is now?

robert-scheck commented 5 years ago

Yes! I actually tested it now again completely on Python 2.6, 2.7, 3.6 and 3.7 on Red Hat Enterprise Linux/CentOS 6, 7 and 8 as well as on Fedora 29, 30 and 31.

linsomniac commented 5 years ago

Thanks so much for the testing, the patch, and working with me on the changes. Closing this and doing a release.