Skip to content

Commit

Permalink
Remove RPM kernel check to add support for other OS without YUM
Browse files Browse the repository at this point in the history
  • Loading branch information
JKJameson authored and Jason Dillaman committed Aug 27, 2019
1 parent 363d8f3 commit e320624
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
2 changes: 0 additions & 2 deletions ceph-iscsi.spec
Expand Up @@ -45,7 +45,6 @@ Requires: python-rados >= 10.2.2
Requires: python-rbd >= 10.2.2
Requires: python-netifaces >= 0.10.4
Requires: python-rtslib >= 2.1.fb68
Requires: rpm-python >= 4.11
Requires: python-cryptography
Requires: python-flask >= 0.10.1
Requires: python-configshell >= 1.1.fb25
Expand All @@ -63,7 +62,6 @@ Requires: python3-netifaces >= 0.10.4
Requires: python3-rtslib >= 2.1.fb68
Requires: python3-cryptography
Requires: python3-pyOpenSSL
Requires: python3-rpm >= 4.11
%if 0%{?suse_version}
BuildRequires: python-rpm-macros
BuildRequires: fdupes
Expand Down
20 changes: 2 additions & 18 deletions rbd-target-api.py 100755 → 100644
Expand Up @@ -16,7 +16,6 @@
import copy

from functools import (reduce, wraps)
from rpm import labelCompare
import rados
import rbd

Expand Down Expand Up @@ -2624,10 +2623,8 @@ def pre_reqs_errors():
"opensuse-leap": "suse"}
valid_dists = {
"redhat": 7.4,
"suse": 15.1}

k_vers = '3.10.0'
k_rel = '823.el7'
"suse": 15.1,
"debian": 10}

errors_found = []

Expand All @@ -2649,19 +2646,6 @@ def pre_reqs_errors():
else:
errors_found.append("OS is unsupported")

# check the running kernel is OK (required kernel has patches to rbd.ko)
os_info = os.uname()
this_arch = os_info[-1]
this_kernel = os_info[2].replace(".{}".format(this_arch), '')
this_ver, this_rel = this_kernel.split('-', 1)

# use labelCompare from the rpm module to handle the comparison
if labelCompare(('1', this_ver, this_rel), ('1', k_vers, k_rel)) < 0:
logger.error("Kernel version check failed")
errors_found.append("Kernel version too old - {}-{} "
"or above needed".format(k_vers,
k_rel))

return errors_found


Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Expand Up @@ -22,6 +22,5 @@ deps =
cryptography
rtslib_fb
netifaces
rpm
commands=
{envbindir}/py.test --ignore=test/test_group.py test/
{envbindir}/py.test --ignore=test/test_group.py test/

0 comments on commit e320624

Please sign in to comment.