Use python 3 compatible scripting

Registered by Valeriy Ponomaryov

Manila has dependencies, that does not work with python 3 yet, but we already can start using python 3 compatible code to minimize work in future.

Common patterns:
    Replace dict.iteritems() with six.iteritems(dict)
    Replace iterator.next() with six.next(iterator)
    Replace basestring with six.string_types
    Replace unicode with six.text_type

More detail info: https://wiki.openstack.org/wiki/Python3

Blueprint information

Status:
Complete
Approver:
None
Priority:
Low
Drafter:
Valeriy Ponomaryov
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Goutham Pacha Ravi
Completed by
Goutham Pacha Ravi

Related branches

Sprints

Whiteboard

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

Addressed by: https://review.openstack.org/104181
    Replace python print operator with print function (pep H233, py33)

Addressed by: https://review.openstack.org/105227
    py33: use six.iteritems for item iterations (part1)

Addressed by: https://review.openstack.org/105713
    Cleanup manila.utils module (part1)

Addressed by: https://review.openstack.org/105732
    py33: use six.iteritems for item iterations (part2)

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

Addressed by: https://review.openstack.org/106379
    py3.x: Use six.text_type() instead of unicode()

Addressed by: https://review.openstack.org/109269
    py3: use six.string_types instead of basestring

Addressed by: https://review.openstack.org/118014
    py3: Use six module for StringIO imports

Addressed by: https://review.openstack.org/144133
    py3: use six.moves.urllib.parse instead of urlparse

Addressed by: https://review.openstack.org/144208
    py3: use six.moves.range instead of xrange

Addressed by: https://review.openstack.org/144396
    py3: use function next() instead of next() method on iterator objects

Addressed by: https://review.openstack.org/206964
    Fix imports for py34 compatibility

Addressed by: https://review.openstack.org/206992
    Fix ZFSSA driver for py34 compatibility

Addressed by: https://review.openstack.org/207003
    Fix exceptions handling for py34 compatibility

Addressed by: https://review.openstack.org/207773
    Replace (int, long) with six.integer_types.

Addressed by: https://review.openstack.org/207776
    Fix /manila/tests/api/test_common.py for py34 compatibitity

Addressed by: https://review.openstack.org/207778
    Replace 'values()' with 'six.iretvalues'.

Addressed by: https://review.openstack.org/207782
    Replace '__metaclass__' with '@six.add_metaclass'

Addressed by: https://review.openstack.org/207789
    Replace 'types.StringTypes' with 'six.string_types'

Addressed by: https://review.openstack.org/207813
    Fix string encoding for Python 3 compatibility

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

Addressed by: https://review.openstack.org/207818
    Fix dictionary initialization for Python 3 compatibility

Addressed by: https://review.openstack.org/207820
    Fix list creation

Addressed by: https://review.openstack.org/207831
    In Python 3 request body should be bytes string

Addressed by: https://review.openstack.org/208360
    Fix py34 tox job

Addressed by: https://review.openstack.org/208384
    Fix convertions to integer for py34 compatibility

Addressed by: https://review.openstack.org/208449
    Replace py2 xrange with six.moves.range

Addressed by: https://review.openstack.org/209571
    Stop using deprecated contextlib.nested

Addressed by: https://review.openstack.org/209885
    Make QuobyteHttpsConnectionWithCaVerification py3 compatible

Addressed by: https://review.openstack.org/210252
    Remove ordering attempts of 'unorderable types'

Addressed by: https://review.openstack.org/210308
    Make 'utils.monkey_patch' py3 compatible

Addressed by: https://review.openstack.org/210353
    Fix 'hacking' unit tests for py3 compatibility

Addressed by: https://review.openstack.org/210361
    Fix HTTP headers case for API unit tests

Addressed by: https://review.openstack.org/210372
    Skip unit tests for SSL + py3

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

Addressed by: https://review.openstack.org/263732
    Replace LOG.warn with LOG.warning

Addressed by: https://review.openstack.org/268866
    Using dict.items() is better than six.iteritems(dict)

Addressed by: https://review.openstack.org/320962
    Hacking check for str in exception breaks in py34

Addressed by: https://review.openstack.org/508308
    py3.x: Use six.text_type() instead of unicode()

Addressed by: https://review.openstack.org/508309
    py3.x: split()

Addressed by: https://review.openstack.org/508310
    py3.x: reload_module

Addressed by: https://review.openstack.org/508311
    py3.x: list() syntax

Addressed by: https://review.openstack.org/531645
    Remove ordering attempts of 'unorderable types'

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.