Dmitrii Shcherbakov 4822b45230 py3: use binary mode for opening image files
If binary mode is not used when running with python3 glance image
uploads fail as files are opened with encoding='UTF-8' by default.

It results in the following confusing error message:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfb in position 3:
invalid start byte

(Pdb) e
UnicodeDecodeError('utf-8', b'QFI\xfb\x00\x00\

0xfb is a QCOW magic string and is invalid from UTF-8 standard
perspective. From the QCOW2 spec:

Byte  0 -  3:   magic
                QCOW magic string ("QFI\xfb")

Tracing have shown that the error comes from python-glanceclient when a
file handle passed to it is attempted to be used for sending image
chunks.

Change-Id: I6bb31fe1d3f79a8fd4707a5576204dee69a3f307
Depends-On: I4991acccefd4754e209feafd5e24d03c76c283f8
Closes-Bug: #1819274
2019-03-20 14:56:07 +00:00
..
2019-01-10 09:28:59 -05:00
2018-04-05 12:41:22 +03:00
2018-02-16 20:05:45 +02:00
2018-02-16 20:05:45 +02:00
2018-10-17 15:21:42 +08:00
2018-02-16 20:05:45 +02:00