mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0055-v2v-o-rhv-upload-decouple-name-of-nbdkit-python-plug.patch

d0ea73
From 6e71dcc1c9c1d8dd37da3f0fd71fc97cc5cbe92f Mon Sep 17 00:00:00 2001
d0ea73
From: Pino Toscano <ptoscano@redhat.com>
d0ea73
Date: Thu, 13 Dec 2018 18:36:20 +0100
d0ea73
Subject: [PATCH] v2v: -o rhv-upload: decouple name of nbdkit python plugin
d0ea73
d0ea73
Do not assume that the Python plugin of nbdkit has the same name of the
d0ea73
Python interpreter.
d0ea73
d0ea73
Use the default upstream name of nbdkit to identify it; downstream
d0ea73
distributions must adjust this variable, in case they rename the Python
d0ea73
plugin of nbdkit.
d0ea73
d0ea73
(cherry picked from commit 6b80c5fb51f08d3e62393e6722655bbcd940f4e7)
d0ea73
---
d0ea73
 v2v/output_rhv_upload.ml | 5 +++--
d0ea73
 1 file changed, 3 insertions(+), 2 deletions(-)
d0ea73
d0ea73
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
d0ea73
index 7dbd98a0d..79a2fc8fd 100644
d0ea73
--- a/v2v/output_rhv_upload.ml
d0ea73
+++ b/v2v/output_rhv_upload.ml
d0ea73
@@ -79,6 +79,7 @@ let parse_output_options options =
d0ea73
   { rhv_cafile; rhv_cluster; rhv_direct; rhv_verifypeer }
d0ea73
 
d0ea73
 let python3 = "python3" (* Defined by PEP 394 *)
d0ea73
+let nbdkit_python_plugin = "python"
d0ea73
 let pidfile_timeout = 30
d0ea73
 let finalization_timeout = 5*60
d0ea73
 
d0ea73
@@ -155,7 +156,7 @@ class output_rhv_upload output_alloc output_conn
d0ea73
    *)
d0ea73
   let error_unless_nbdkit_python3_working () =
d0ea73
     let cmd = sprintf "nbdkit %s %s --dump-plugin >/dev/null"
d0ea73
-                      python3 (quote plugin) in
d0ea73
+                      nbdkit_python_plugin (quote plugin) in
d0ea73
     if Sys.command cmd <> 0 then
d0ea73
       error (f_"nbdkit Python 3 plugin is not installed or not working.  It is required if you want to use ‘-o rhv-upload’.
d0ea73
 
d0ea73
@@ -222,7 +223,7 @@ See also \"OUTPUT TO RHV\" in the virt-v2v(1) manual.")
d0ea73
       "--newstyle";             (* use newstyle NBD protocol *)
d0ea73
       "--exportname"; "/";
d0ea73
 
d0ea73
-      "python3";                (* use the nbdkit Python 3 plugin *)
d0ea73
+      nbdkit_python_plugin;     (* use the nbdkit Python plugin *)
d0ea73
       plugin;                   (* Python plugin script *)
d0ea73
     ] in
d0ea73
     let args = if verbose () then args @ ["--verbose"] else args in
d0ea73
-- 
6b9fda
2.21.0
d0ea73