oVirt/ovirt-imageio

Change --engine-url for --fqdn

aesteve-rh opened this issue · 2 comments

Current argument --engine-url doesn't make sense. https://[fqdn] is not an engine url.

It should either ask just for fqdn, or “engine url” should be https://[fqdn]/ovirt-engine, or ask for engine api url and that would be https://[fqdn]/ovirt-engine/api. But as it stands right now it's misleading.

nirs commented

I don’t think current url is misleading. To access engine in a browser you use ‘https://fqdn-or-ip/‘ and we require the the same for the tool.

We used this for several years in the sdk examples and we had nobody complained about this.

If the issue is people trying to use the api url (https://fqdn-or-ip/ovirt-engine/api), we can support both by adding the path only if it is missing. But the url is called engine_url and not engine_api_url.

It is true that sdk examples use the same naming convention, but I see discrepancies in other oVirt projects, where engine_url refers to the full api URL.

So to be on the safe side and avoid confusion and potential additional support, I'd go for either the --fqdn (as in ovirt-stress) or, as you say, support both URLs (i.e., https://[fqdn] and https://[fqdn]/ovirt-engine/api) with --engine-url. If you prefer the latter, I'm happy with that solution too.

Also, if we keep --engine-url, note that https://[fqdn]/ will make it fail, as we do string manipulation and duplicate the slash. So we can to add a simple url validator that corrects small issues like that.