mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone
Blob Blame History Raw
From 28677fd0f1eeb7d2ace15375cadfe8cc53c35ac9 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Sun, 16 Dec 2018 16:42:46 +0100
Subject: [PATCH] RHEL 8: use platform-python

Use the stable platform-python provided in BaseOS, instead of relying on
some arbitrary version installed by the user.
---
 v2v/output_rhv_upload.ml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
index 1c102dc24..4e1362d98 100644
--- a/v2v/output_rhv_upload.ml
+++ b/v2v/output_rhv_upload.ml
@@ -78,7 +78,7 @@ let parse_output_options options =
 
   { rhv_cafile; rhv_cluster; rhv_direct; rhv_verifypeer }
 
-let python3 = "python3" (* Defined by PEP 394 *)
+let python3 = "/usr/libexec/platform-python"
 let nbdkit_python_plugin = "python3"
 let pidfile_timeout = 30
 let finalization_timeout = 5*60
@@ -121,8 +121,8 @@ class output_rhv_upload output_alloc output_conn
 
   (* Check that the Python binary is available. *)
   let error_unless_python_binary_on_path () =
-    try ignore (which python3)
-    with Executable_not_found _ ->
+    try ignore (Unix.access python3 [Unix.X_OK])
+    with Unix_error _ ->
       error (f_"no python binary called ā€˜%sā€™ can be found on the $PATH")
             python3
   in
-- 
2.21.0