]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script/cpatch.py: add support for multiple valid python versions 58054/head
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 14 Jun 2024 14:07:07 +0000 (10:07 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 14 Jun 2024 14:07:07 +0000 (10:07 -0400)
Fix running cpatch.py with the latest centos9s based container images.
Future proof a little by adding multiple valid, existing, python version
numbers to probe.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/script/cpatch.py

index fa1cecc5943b008da2d99044e5b7a11364d948b3..4ff9bd999d21b3c325836cb10d689203794966e4 100755 (executable)
@@ -549,9 +549,9 @@ class Builder:
         if self._cached_py_site_packages is not None:
             return self._cached_py_site_packages
         # use the container image to probe for the correct python site-packages dir
+        py_vers = ['3.12', '3.11', '3.10', '3.9', '3.8', '3.6']
         valid_site_packages = [
-            "/usr/lib/python3.8/site-packages",
-            "/usr/lib/python3.6/site-packages",
+            f'/usr/lib/python{v}/site-packages' for v in py_vers
         ]
         cmd = [
             self._ctx.engine,