Bug 1865830 - download_disk_snapshots.py example script is broken
Summary: download_disk_snapshots.py example script is broken
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: ovirt-engine-sdk-python
Classification: oVirt
Component: General
Version: ---
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Ori Liel
QA Contact: Avihai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-04 09:57 UTC by Ilan Zuckerman
Modified: 2022-04-11 09:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-11 08:54:13 UTC
oVirt Team: Storage
Embargoed:
sbonazzo: ovirt-4.5-


Attachments (Terms of Use)
logs (4.72 KB, application/zip)
2020-08-04 09:57 UTC, Ilan Zuckerman
no flags Details

Description Ilan Zuckerman 2020-08-04 09:57:56 UTC
Created attachment 1710300 [details]
logs

Description of problem:

Example script for downloading snapshot disk is broken:
/usr/share/doc/python3-ovirt-engine-sdk4/examples/download_disk_snapshots.py

102             transfer_headers = {
103                 'Authorization': transfer.signed_ticket,
104             }

Authorization header is unused since 4.2.0, and in 4.4 it is always None, which breaks
this code.

We have a bug for removing it completely here:
https://bugzilla.redhat.com/show_bug.cgi?id=1862722

Version-Release number of selected component (if applicable):
python3-ovirt-engine-sdk4-4.4.4-1.el8ev.x86_64
rhv-release-4.4.1-12-001.noarch

How reproducible:
100%

Steps to Reproduce:
1. Modify the script with correct values:
url='https://storage-xxx.redhat.com/ovirt-engine/api',
        username='xxx',
        password='xxx',
        ca_file='/root/ca.pem',

    disk_id = '985c5bbb-2732-4738-8cbe-a2557fe9edd4'
    sd_name = 'iscsi_0'


2. python3 /usr/share/doc/python3-ovirt-engine-sdk4/examples/download_disk_snapshots.py


Actual results:

Downloading disk snapshot 6beb8bd7-c554-4277-a6ad-ebaa87af4167
Traceback (most recent call last):
  File "/usr/share/doc/python3-ovirt-engine-sdk4/examples/download_disk_snapshots.py", line 189, in <module>
    download_disk_snapshot(disk_snapshot)
  File "/usr/share/doc/python3-ovirt-engine-sdk4/examples/download_disk_snapshots.py", line 110, in download_disk_snapshot
    headers=transfer_headers,
  File "/usr/lib64/python3.6/http/client.py", line 1254, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1295, in _send_request
    self.putheader(hdr, value)
  File "/usr/lib64/python3.6/http/client.py", line 1231, in putheader
    if _is_illegal_header_value(values[i]):
TypeError: expected string or bytes-like object


Expected results:
Download should work

Additional info:
Attaching daemon.log example.log (log of the example script)

Comment 4 Michal Skrivanek 2022-04-11 08:54:13 UTC
no update for a while, didn't make it into 4.5, closing


Note You need to log in before you can comment on or make changes to this bug.