]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
py3: Fix usage of JSON in API contrib
authorVictor Stinner <vstinner@redhat.com>
Tue, 9 Feb 2016 17:38:11 +0000 (18:38 +0100)
committerVictor Stinner <vstinner@redhat.com>
Tue, 9 Feb 2016 17:48:59 +0000 (18:48 +0100)
commitce018c91b160ac7967ca40a3d055ce9a8bccf7ec
tree65a9893d8bae1e87fab2c0ede5cf50632d0d2c6a
parent8311e7360f039d3ffbcd013180881e4cf0dedb4d
py3: Fix usage of JSON in API contrib

Replace json.dumps() and jsonutils.dumps() with
jsonutils.dump_as_bytes() to get bytes on Python 3. The result is
used as HTTP body, and the body type must be bytes.

Replace also json.loads() with jsonutils.loads().

Partial-Implements: blueprint cinder-python3
Change-Id: I3d3a18f2013b42dc2d8d7b90f32f50756513d668
cinder/tests/unit/api/contrib/test_backups.py
cinder/tests/unit/api/contrib/test_consistencygroups.py
cinder/tests/unit/api/contrib/test_volume_actions.py
cinder/tests/unit/api/contrib/test_volume_image_metadata.py
cinder/tests/unit/api/contrib/test_volume_replication.py
cinder/tests/unit/api/contrib/test_volume_transfer.py
cinder/tests/unit/api/contrib/test_volume_type_encryption.py