v2v: -o rhv-upload: check for ovirtsdk4 (RHBZ#1601943)

Check earlier whether the ovirtsdk4 Python can be imported correctly,
to avoid errors later on during the migration.
This commit is contained in:
Pino Toscano
2018-07-17 17:12:38 +02:00
parent 77604b91ec
commit bb6b81861e

View File

@@ -126,6 +126,13 @@ class output_rhv_upload output_alloc output_conn
python3
in
(* Check that the 'ovirtsdk4' Python module is available. *)
let error_unless_ovirtsdk4_module_available () =
let res = run_command [ python3; "-c"; "import ovirtsdk4" ] in
if res <> 0 then
error (f_"the Python module ovirtsdk4 could not be loaded, is it installed? See previous messages for problems.")
in
(* Check that nbdkit is available and new enough. *)
let error_unless_nbdkit_working () =
if 0 <> Sys.command "nbdkit --version >/dev/null" then
@@ -231,6 +238,7 @@ object
method precheck () =
error_unless_python_binary_on_path ();
error_unless_ovirtsdk4_module_available ();
error_unless_nbdkit_working ();
error_unless_nbdkit_python3_working ();
error_unless_output_alloc_sparse ();