ConfigDrive creation fails on Python 3

Bug #1502583 reported by Alessandro Pilotti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Alessandro Pilotti
Liberty
Fix Released
Medium
Alessandro Pilotti

Bug Description

On Python 3, attempting to create a ConfigDrive fails when writing files due to str / bytes differences compared to Python 2.

Tags: python3
Changed in nova:
status: New → Triaged
assignee: nobody → Alessandro Pilotti (alexpilotti)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/230800

Changed in nova:
status: Triaged → In Progress
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/230800
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=414243ace138242726b253ca080be0feb70cacc0
Submitter: Jenkins
Branch: master

commit 414243ace138242726b253ca080be0feb70cacc0
Author: Alessandro Pilotti <email address hidden>
Date: Sun Oct 4 14:03:05 2015 +0300

    Fixes Python 3 str issue in ConfigDrive creation

    ConfigDrive creation fails when writing metadata to file
    due to a str to bytes conversion issue.

    Change-Id: I4c086007543814a2f2ec3f7ccde9e8f9f2b5937f
    Closes-Bug: #1502583

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/232649

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/237786

Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

Current patch on review (launchpad didnt pick it up):

https://review.openstack.org/#/c/237786/

Setting status "in progress" as the committed patch was reverted

Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/237786
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f395f457976fe7e5b91aa6c0910f790efe9be221
Submitter: Jenkins
Branch: master

commit f395f457976fe7e5b91aa6c0910f790efe9be221
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
    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

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/246792

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/nova 13.0.0.0b1

This issue was fixed in the openstack/nova 13.0.0.0b1 development milestone.

Changed in nova:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/liberty)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/232649
Reason: The other fix is backported here https://review.openstack.org/#/c/246792/ and that's approved now.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/liberty)

Reviewed: https://review.openstack.org/246792
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0134d88b750c304fa893ed4778806e56ec410857
Submitter: Jenkins
Branch: stable/liberty

commit 0134d88b750c304fa893ed4778806e56ec410857
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
    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)

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 12.0.1

This issue was fixed in the openstack/nova 12.0.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.