[Libguestfs] [PATCH] v2v: -o openstack: Check openstack binary exists before running it.

Pino Toscano ptoscano at redhat.com
Wed Dec 5 17:33:00 UTC 2018


On Tuesday, 20 November 2018 10:16:28 CET Richard W.M. Jones wrote:
> Improves the error message when openstack is not installed:
> 
> $ virt-v2v -i disk fedora-28.img -o openstack
> virt-v2v: error: no binary called ‘openstack’ was found on the $PATH.
> We use this program to communicate with OpenStack so it must be installed
> to use this output mode.
> ---

Generally OK, just one minor note below.

> +  let error_unless_openstack_command_exists () =
> +    try ignore (which openstack_binary)
> +    with Executable_not_found _ ->
> +      error (f_"no binary called ‘%s’ was found on the $PATH.  We use this program to communicate with OpenStack so it must be installed to use this output mode.")
> +         openstack_binary

IMHO the error string is a bit too much verbose -- what about something
like:
"the ‘%s’ program is not available.  It is needed to communicate with
 OpenStack"

Also, I think it would be good to mention the requirement of this
command line client in virt-v2v-output-openstack(1), and "glance" for
-o glance too.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20181205/7186112f/attachment.sig>


More information about the Libguestfs mailing list