Blame SOURCES/0083-RHEL-8-use-platform-python.patch

c1122e
From 83e68a8844c9c20fbee98dc784fd82f60e225417 Mon Sep 17 00:00:00 2001
df3bb2
From: Pino Toscano <ptoscano@redhat.com>
df3bb2
Date: Sun, 16 Dec 2018 16:42:46 +0100
df3bb2
Subject: [PATCH] RHEL 8: use platform-python
df3bb2
df3bb2
Use the stable platform-python provided in BaseOS, instead of relying on
df3bb2
some arbitrary version installed by the user.
df3bb2
---
df3bb2
 v2v/output_rhv_upload.ml | 6 +++---
df3bb2
 1 file changed, 3 insertions(+), 3 deletions(-)
df3bb2
df3bb2
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
df3bb2
index 13c175f2d..f95ac0d65 100644
df3bb2
--- a/v2v/output_rhv_upload.ml
df3bb2
+++ b/v2v/output_rhv_upload.ml
df3bb2
@@ -78,7 +78,7 @@ let parse_output_options options =
df3bb2
 
df3bb2
   { rhv_cafile; rhv_cluster; rhv_direct; rhv_verifypeer }
df3bb2
 
df3bb2
-let python3 = "python3" (* Defined by PEP 394 *)
df3bb2
+let python3 = "/usr/libexec/platform-python"
df3bb2
 let nbdkit_python_plugin = "python3"
df3bb2
 let pidfile_timeout = 30
df3bb2
 let finalization_timeout = 5*60
df3bb2
@@ -121,8 +121,8 @@ class output_rhv_upload output_alloc output_conn
df3bb2
 
df3bb2
   (* Check that the Python binary is available. *)
df3bb2
   let error_unless_python_binary_on_path () =
df3bb2
-    try ignore (which python3)
df3bb2
-    with Executable_not_found _ ->
df3bb2
+    try ignore (Unix.access python3 [Unix.X_OK])
df3bb2
+    with Unix_error _ ->
df3bb2
       error (f_"no python binary called ā€˜%sā€™ can be found on the $PATH")
df3bb2
             python3
df3bb2
   in
df3bb2
-- 
df3bb2
2.21.0
df3bb2