[Libguestfs] [PATCH] v2v: -o rhv-upload: decouple name of nbdkit python plugin
Richard W.M. Jones
rjones at redhat.com
Mon Jan 7 13:30:00 UTC 2019
On Thu, Dec 13, 2018 at 06:58:30PM +0100, Pino Toscano wrote:
> Do not assume that the Python plugin of nbdkit has the same name of the
> Python interpreter.
>
> Use the default upstream name of nbdkit to identify it; downstream
> distributions must adjust this variable, in case they rename the Python
> plugin of nbdkit.
I'm not saying this is wrong, but it does break "out of the box" -o
rhv-upload. It means that to get it to work on Fedora we _have_ to
patch:
> --- a/v2v/output_rhv_upload.ml
> +++ b/v2v/output_rhv_upload.ml
> @@ -78,6 +78,7 @@ let parse_output_options options =
>
> { rhv_cafile; rhv_cluster; rhv_direct; rhv_verifypeer }
>
> +let nbdkit_python_plugin = "python"
to change this "python3" [1].
I would dearly love to drop Python 2 support everywhere, but I don't
think we can do that realisticly before the Python 2 EOL
(https://pythonclock.org/) which is another 12 months away.
I wonder if there's a better way we can solve this? I don't have any
immediate ideas ...
Rich.
[1] By the way, the failure is weird, non-obvious and non-actionable,
so here it is:
nbdkit python '/home/rjones/d/libguestfs-master/tmp/v2v.xSFDLk/rhv-upload-plugin.py' --dump-plugin >/dev/null
File "/home/rjones/d/libguestfs-master/tmp/v2v.xSFDLk/rhv-upload-plugin.py", line 3
SyntaxError: Non-ASCII character '\xe2' in file /home/rjones/d/libguestfs-master/tmp/v2v.xSFDLk/rhv-upload-plugin.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
nbdkit: error: /home/rjones/d/libguestfs-master/tmp/v2v.xSFDLk/rhv-upload-plugin.py: error running this script
virt-v2v: error: nbdkit python plugin is not installed or not working. It
is required if you want to use ‘-o rhv-upload’.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
More information about the Libguestfs
mailing list