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

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