From: Dan Mick Date: Wed, 17 May 2023 00:05:15 +0000 (-0700) Subject: task/kernel.py: sort installed kernels by version X-Git-Tag: 1.2.0~108^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3c9e82e4da55202575dba42eee57203962011407;p=teuthology.git task/kernel.py: sort installed kernels by version rpm -q --last sorts by timestamp-of-install, which does not necessarily correlate with "latest version". sort -rV does. Signed-off-by: Dan Mick --- diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index c0c2a1f553..70d49059c6 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -1053,9 +1053,9 @@ def get_latest_image_version_rpm(remote): kernel_pkg_name = "kernel-default" else: kernel_pkg_name = "kernel" - # get tip of package list ordered by install time + # get tip of package list ordered by descending version newest_package = remote.sh( - 'rpm -q %s --last | head -n 1' % kernel_pkg_name).strip() + 'rpm -q %s | sort -rV | head -n 1' % kernel_pkg_name).strip() for kernel in newest_package.split(): if kernel.startswith('kernel'): if 'ceph' not in kernel: