]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/qemu: Fix OS version comparison
authorZack Cerza <zack@redhat.com>
Fri, 14 Jun 2024 19:37:16 +0000 (13:37 -0600)
committerYuri Weinstein <yweinste@redhat.com>
Wed, 26 Jun 2024 23:52:38 +0000 (23:52 +0000)
See: https://sentry.ceph.com/share/issue/21ed88d705854238bdafbf6711e795ee/
They're strings, not floats.
This surfaced as a result of https://github.com/ceph/teuthology/pull/1953

Signed-off-by: Zack Cerza <zack@redhat.com>
(cherry picked from commit 260a45a03148ba4d2bbfcac9485bcf9a8743cade)
(cherry picked from commit c67550651bc7dbc4680ddb2a56bd90b5ee6032fc)

qa/tasks/qemu.py

index 336d2a0fe671af05afd38949ad079e1f651d9b96..760e4b82b73c00feff6d3c8b2863dd291b1bdb9e 100644 (file)
@@ -8,6 +8,8 @@ import os
 import yaml
 import time
 
+from packaging.version import Version
+
 from tasks import rbd
 from tasks.util.workunit import get_refspec_after_overrides
 from teuthology import contextutil
@@ -492,7 +494,10 @@ def run_qemu(ctx, config):
             )
 
         nfs_service_name = 'nfs'
-        if remote.os.name in ['rhel', 'centos'] and float(remote.os.version) >= 8:
+        if (
+            remote.os.name in ['rhel', 'centos'] and
+            Version(remote.os.version.lower().removesuffix(".stream")) >= Version("8")
+        ):
             nfs_service_name = 'nfs-server'
 
         # make an nfs mount to use for logging and to