On Tue, Mar 24, 2020 at 9:55 AM Nir Soffer <nsoffer@redhat.com> wrote:
Moved discussion from private chat to the proper place. Please use the mailing
list instead of private email or chat.

> about this issue https://github.com/ansible/ansible/issues/68403
> should I rewrite the upload so it would work as
> https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_disk.py?

Yes

> If I remember correctly it works only with 4.4 SDK?

upload_disk.py is assuming oVirt 4.4, as part of ovirt-4.4 release.

However imageio client library used by upload_disk.py tries to support
any version
of imageio, both proxy and daemon so the upload should work with any version.
If it does not work please file ovirt-imageio bug.

upload_disk.py assumes that the sdk supports the "format" attribute of
ImageTransfer.
This should be available since 4.3 and should work.

Common issues with old upload code are:
- using proxy_url instead of transfer_url
- using signed_ticket and Authorization header

ImageTransfer.proxy_url should be used only when you cannot access
ImageTransfer.transfer_url.
It also provides worse performance and partial functionality. The
proxy was added to support upload
and download from the UI, but programs should avoid it if possible.

ImageTransfer.signed_ticket and Authorization header were used only up
to 4.2 (or maybe 4.1).
There is no need to send this header to the proxy since it does not
use it. The daemon never
support this header.

Note that imageio client library import is going to change in 4.4.
release. In 4.3 it was
via:

   from ovirt_imageio_common import client

While in 4.4 it will be:

   from ovirt_imageio import client

Due to restructure of the ovirt-imageio deployment in ovirt-imageio 2.0.
This affects only python 3 version, and only oVirt 4.4 alpha.

To support both 4.4. alpha and 4.4 final release you can do:

try:
    from ovirt_imageio_common import client
except ImportError:
    from ovirt_imageio import client

If you don't care about supporting early alpha versions you can have:

python2:
from ovirt_imageio_common import client

python 3:
from ovirt_imageio import client

Nir, could you please create RFE on https://github.com/ovirt/ovirt-ansible-collection/issues to properly track it and with all the details which are needed for implementation?

Also I highly encourage anyone from storage a post a fix for that, because infra team don't have enough resources to know implementation details for all the features provided by other teams. Of course we can help with Ansible code, but we don't have enough resources to implement it completely.

Thanks,
Martin


Nir
_______________________________________________
Devel mailing list -- devel@ovirt.org
To unsubscribe send an email to devel-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/devel@ovirt.org/message/FNJGRY5VUBQ7YTLZXKXBXLGO5PFUE4QP/


--
Martin Perina
Manager, Software Engineering
Red Hat Czech s.r.o.