]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
kernel: make get_image_version() work for rpm 1919/head
authorIlya Dryomov <idryomov@gmail.com>
Wed, 14 Feb 2024 19:05:54 +0000 (20:05 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 14 Feb 2024 19:16:02 +0000 (20:16 +0100)
At some point in the past, the layout of the rpm package has changed.
There is no file matching "/boot/vmlinuz-" there anymore, instead there
is "vmlinuz" file at the root of the modules directory.  For reference:

deb:

-rw-r--r-- root/root  11527168 2024-02-13 16:25 ./boot/vmlinuz-6.8.0-rc4-ga64ccd305b28
-rw-r--r-- root/root     72614 2024-02-13 16:25 ./lib/modules/6.8.0-rc4-ga64ccd305b28/modules.order

rpm:

/lib/modules/6.8.0-rc4-ga64ccd305b28/modules.order
/lib/modules/6.8.0-rc4-ga64ccd305b28/vmlinuz

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
teuthology/task/kernel.py

index 70d49059c6e65f334d596009e2e98e14119b62ed..ca4718784c298b10b0f83f5ca2a084e52c431348 100644 (file)
@@ -1033,8 +1033,9 @@ def get_image_version(remote, path):
         raise UnsupportedPackageTypeError(remote)
 
     for file in files.split('\n'):
-        if '/boot/vmlinuz-' in file:
-            version = file.split('/boot/vmlinuz-')[1]
+        match = re.search('/lib/modules/(.*)/modules\.order$', file)
+        if match:
+            version = match.group(1)
             break
 
     log.debug("get_image_version: %s", version)