|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
#!/usr/bin/python
|
|
|
|
|
from __future__ import division, print_function
|
|
|
|
|
from distutils.version import LooseVersion
|
|
|
|
|
import posixpath
|
|
|
|
|
import re
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
@ -22,7 +23,16 @@ def running_kernel_version():
|
|
|
|
|
return version
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_fedora():
|
|
|
|
|
return posixpath.exists('/etc/fedora-release')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def installed_kernel_versions():
|
|
|
|
|
if is_fedora():
|
|
|
|
|
return installed_kernel_versions_fedora()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def installed_kernel_versions_fedora():
|
|
|
|
|
rpm_out = subprocess.check_output(
|
|
|
|
|
['rpm', '--queryformat=%{VERSION}-%{RELEASE}\n', '-q', 'kernel'])
|
|
|
|
|
rpm_out = rpm_out.strip()
|
|
|
|
|