Adding Python 3.4 support to Magnum

Registered by Tom Cammann

All Magnum dependencies (bar oslo.messaging AMQP and Qpid support) are now python 3 compatible, Magnum should also be python 3 compatible without losing python 2 support.

Other OpenStack projects have progress underway on python 3 support, see https://wiki.openstack.org/wiki/Python3#Python_3_Status_of_OpenStack_projects

'caniusepython3' also agrees that Magnum dependencies are python 3 compatible: https://caniusepython3.com/check/179bd480-7b23-45da-83b1-ea042191ba21

A python3.4 test job (non-voting initially) will also be setup to test this compatibility.

Blueprint information

Status:
Not started
Approver:
hongbin
Priority:
Undefined
Drafter:
Tom Cammann
Direction:
Approved
Assignee:
Tom Cammann
Definition:
Discussion
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

@hongyang: After my series patches for python3 compatibility, we can pass python34 unit test, I think we
can enable py34-unit gate job(non-voting) now:
======
Totals
======
Ran: 1150 tests in 18.8871 sec.
 - Passed: 1150
 - Skipped: 0
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 0
Sum of execute time for each test: 31.0744 sec.

==============
Worker Balance
==============
 - Worker 0 (287 tests) => 0:00:08.435993
 - Worker 1 (288 tests) => 0:00:08.491709
 - Worker 2 (287 tests) => 0:00:09.313717
 - Worker 3 (288 tests) => 0:00:06.976586
_______________________________________________________________ summary _______________________________________________________________
  py34: commands succeeded
  congratulations :)

Gerrit topic: https://review.openstack.org/#q,topic:python3,n,z

Addressed by: https://review.openstack.org/195270
    Replace dict.iteritems() with six.iteritems(dict)

Gerrit topic: https://review.openstack.org/#q,topic:py3,n,z

Addressed by: https://review.openstack.org/196649
    Upgrade code to be python 3 compatible

Addressed by: https://review.openstack.org/199189
    Check for Python 2 when using unicode builtin

Gerrit topic: https://review.openstack.org/#q,topic:bp/magnum-python3,n,z

Addressed by: https://review.openstack.org/260581
    Replace dict.iteritems() with dict.items()

Addressed by: https://review.openstack.org/262117
    Python 3 use logger.warning instead of log.warn

Addressed by: https://review.openstack.org/262402
    Use six.moves.reload_module instead of builtin reload

Gerrit topic: https://review.openstack.org/#q,topic:bug/1290234,n,z

Addressed by: https://review.openstack.org/262512
    Do not use __builtin__ in python3

Gerrit topic: https://review.openstack.org/#q,topic:rename__bulitin__,n,z

Addressed by: https://review.openstack.org/264079
    Do not use __builtin__ in python3

Gerrit topic: https://review.openstack.org/#q,topic:bp/murano-python-3-support,n,z

Addressed by: https://review.openstack.org/273447
    Add python 3 support

Addressed by: https://review.openstack.org/285478
    Correctly compare utf8 strings

Addressed by: https://review.openstack.org/285689
    Avoid compare None type using min()

Addressed by: https://review.openstack.org/285690
    Use six.moves.reload_module instead of builltin reload

Addressed by: https://review.openstack.org/285691
    Return correct object type

Addressed by: https://review.openstack.org/285692
    Use exception.faultstring instead of exception.message

Addressed by: https://review.openstack.org/285693
    handle bytes list in api middleware

Addressed by: https://review.openstack.org/285694
    Use specific key to sort list of dicts

Addressed by: https://review.openstack.org/285695
    Fix CertificateStorageException arguments

Addressed by: https://review.openstack.org/285696
    Fix x509 cert generation python3 compability

Addressed by: https://review.openstack.org/285697
    Encode string before hash it

Addressed by: https://review.openstack.org/285698
    Convert bytes to string in get_id for python3 compatibility

Addressed by: https://review.openstack.org/285699
    Do not use translate to delete chars

Gerrit topic: https://review.openstack.org/#q,topic:bug/1551394,n,z

Addressed by: https://review.openstack.org/286654
    Use obj_attr_is_set to check whether an attr is set in oslo_versionedobject

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.