rally-openstack has python3-incompatible code in glance image upload and tempest verification code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Rally |
Fix Released
|
Undecided
|
Dmitrii Shcherbakov |
Bug Description
Ran into two errors due to python3 incompatibility in rally-openstack (rev 992419828496abe
rally verify start --id <verifier-uuid> --pattern tempest.
almost immediately fails with:
1) the lack of comparison operator implementation for TempestContext:
xxxx-xx-xx xx:xx:xx.xx 7909 INFO rally.api [-] Starting verification (UUID=<uuid>) for deployment 'snap_generated' (UUID=<uuid>) by verifier 'tempestverifier' (UUID=<uuid>).
'<' not supported between instances of 'TestrContext' and 'TempestContext'
https:/
"The cmp() function should be treated as gone, and the __cmp__() special method is no longer supported. Use __lt__() for sorting, __eq__() with __hash__(), and other rich comparisons as needed. (If you really need the cmp() functionality, you could use the expression (a > b) - (a < b) as the equivalent for cmp(a, b).)"
2) when (1) is fixed, the second error is a bit more cryptic:
xxxx-xx-xx xx:xx:xx.xxx 20731 INFO rally.task.context [-] Verification ea029096-
xxxx-xx-xx xx:xx:xx.xxx 20731 INFO rally.task.context [-] Verification ea029096-
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 3: invalid start byte
Tracing shows that this happens because rally-openstack passes a file opened in a text mode to glance client - it then tries to read binary image content as utf-8-encoded text and almost immediately hits an invalid utf-8 byte which happens to be a QCOW2 magic string:
https:/
<_io.TextIOWrapper name='/
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 3: invalid start byte
> /snap/fcbtest/
-> with vcontext.
(Pdb) e
UnicodeDecodeEr
https:/
Byte 0 - 3: magic
This can be fixed by using 'rb' mode when opening an image file.
Proposed patches: https:/ /review. openstack. org/#/q/ topic:bug/ 1819274+ (status: open+OR+ status: merged)