ConfigDrive creation fails on Python 3 when writing metadata to file
due to the fact that in Python 3 only bytes can be written to a file.
This patch fixes this issue by replacing jsonutils.dumps with
jsonutils.dump_as_bytes and thus ensuring that all data that is to
be written is bytes and not str.
Change-Id: Ie84f8badb185295fe019d80f8036aeb941709342
Closes-Bug: #1502583
(cherry picked from commit f395f457976fe7e5b91aa6c0910f790efe9be221)
Reviewed: https:/ /review. openstack. org/246792 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=0134d88b750 c304fa893ed4778 806e56ec410857
Committed: https:/
Submitter: Jenkins
Branch: stable/liberty
commit 0134d88b750c304 fa893ed4778806e 56ec410857
Author: Adelina Tuvenie <email address hidden>
Date: Tue Oct 20 14:20:52 2015 -0700
Fixes Python 3 str issue in ConfigDrive creation
ConfigDrive creation fails on Python 3 when writing metadata to file
due to the fact that in Python 3 only bytes can be written to a file.
This patch fixes this issue by replacing jsonutils.dumps with dump_as_ bytes and thus ensuring that all data that is to
jsonutils.
be written is bytes and not str.
Change-Id: Ie84f8badb18529 5fe019d80f8036a eb941709342 5b91aa6c0910f79 0efe9be221)
Closes-Bug: #1502583
(cherry picked from commit f395f457976fe7e