Description of problem: Although it says: #!/usr/bin/python3 It fails with Python 3. Switching to: #!/usr/bin/python2 Fixes it and it runs well. Version-Release number of selected component (if applicable): kernel-tools-4.12.5-300.fc26.x86_64 How reproducible: Always Steps to Reproduce: 1. run kvm_stat when a VM is running. 2. 3. Actual results: Expected results: Additional info:
It's definitely python2 only at the moment. Upstream has #!/usr/bin/python, but the version in the RPM has #!/usr/bin/python3, maybe something in the spec changes it automatically? But I couldn't find anything. Can probably just change upstream to have explicit #!/usr/bin/python2 (or #!/usr/bin/env python2 and then overwrite that in the spec file)
It's this Fedora patch: force-python3-in-kvm_stat.patch commit f73ee7240d1ddb1923e93ff9674b51bcfe2e61eb Author: Fedora Kernel Team <kernel-team> Date: Tue Jul 25 12:38:46 2017 -0500 Force python3 in kvm_stat
Right, so this is a fairly significant problem, and the short term solution will likely be kernel dropping kvm_stat for a bit until it works with python 3. I understand the reasoning behind moving it into the kernel tree, but Fedora's default python is python3 at this point. By putting a package which requires python2 in the kernel tools package, you end up with a lot of pissed off people who don't want python2 on their system.
Ah interesting. It's probably not too hard to port to python3, I'll try and take a look. Another option could be to switch it to explicit python2 but not have an explicit python2 dep. Then anyone that wants to use kvm_stat will just have to manually install python2. I think that's probably fine in the short term since I don't think kvm_stat has many users, and python2 will be installed on a lot of systems anyways
kernel-4.12.9-300.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-78c4c71539
kernel-4.12.9-200.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4b4c022807
So the short term work around, I simply removed the dep, and the patch. This is technically incorrect packaging, but it seemed the better short term solution. Longer term, kvm_stat needs to be ported to support python3, and the dep needs to go back in.
kernel-4.12.9-300.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-78c4c71539
kernel-4.12.9-200.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4b4c022807
kernel-4.12.9-300.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.
kernel-4.12.9-200.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
Fedora 28, same story: it doesn't work with Python 3, only with Python 2: [ykaul@ykaul ovirt-system-tests]$ sudo kvm_stat File "/usr/bin/kvm_stat", line 1137 def sortkey((_k, v)): ^ SyntaxError: invalid syntax Switching to Python 2, all good (at least it seems to be running).
It's fixed upstream and in v4.17-rc1 commit 6ade1ae84c9236cbb58de4b17f770f2791106676 Author: Cole Robinson <crobinso> Date: Fri Mar 23 18:07:16 2018 -0400 tools/kvm_stat: Fix python3 syntax
kernel-tools-4.16.0-201.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b8d768a079
kernel-tools-4.16.0-301.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-420e68c0af
Sorry about that, someone reported this on the Bodhi update and I got as far as building the new version with the backport, but forgot to submit it as an update. Testing and providing karma on the updates would be very helpful.
kernel-tools-4.16.0-201.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b8d768a079
kernel-tools-4.16.0-301.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-420e68c0af
kernel-tools-4.16.0-301.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.
kernel-tools-4.16.0-201.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.
$ rpm -qf /usr/bin/kvm_stat kernel-tools-4.16.0-301.fc28.x86_64 $ kvm_stat Traceback (most recent call last): File "/usr/bin/kvm_stat", line 1668, in <module> main() File "/usr/bin/kvm_stat", line 1639, in main assign_globals() File "/usr/bin/kvm_stat", line 1618, in assign_globals for line in file('/proc/mounts'): NameError: name 'file' is not defined
kernel-tools-4.16.0-302.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-00f7901c1b
kernel-tools-4.16.0-202.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-d28f60724e
kernel-tools-4.16.0-202.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-d28f60724e
kernel-tools-4.16.0-302.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-00f7901c1b
kernel-tools-4.16.0-302.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.
kernel-tools-4.16.0-202.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.