full of failures under Python 3

Bug #1755413 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
trove-dashboard
Fix Released
Medium
Zhao Chao

Bug Description

Building trove-dashboard under Python 3.6 in Debian Sid leads to so many errors. Test log attached.

Please get this resolved, or I will have to get trove-dashboard removed from Debian (as Horizon is already switched to Python 3).

Revision history for this message
Thomas Goirand (thomas-goirand) wrote :
Zhao Chao (zhaochao1984)
Changed in trove-dashboard:
assignee: nobody → Zhao Chao (zhaochao1984)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove-dashboard (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove-dashboard (master)

Reviewed: https://review.openstack.org/552847
Committed: https://git.openstack.org/cgit/openstack/trove-dashboard/commit/?id=a5cc40f488610694da92f6d8f86f83460dd2567c
Submitter: Zuul
Branch: master

commit a5cc40f488610694da92f6d8f86f83460dd2567c
Author: Zhao Chao <email address hidden>
Date: Wed Mar 14 17:15:14 2018 +0800

    Fix binascii hexlify under Python 3

    Add wrapper functions for binascii hexlify/unhexlify to deal with the
    conversion between bytes and str.

    Partial-Bug: #1755413

    Change-Id: I8351b30b62ba19290e05c30499c3588649f8f367
    Signed-off-by: Zhao Chao <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/553120
Committed: https://git.openstack.org/cgit/openstack/trove-dashboard/commit/?id=996e134a1c3b903ed38eb355fe4447690a10ed66
Submitter: Zuul
Branch: master

commit 996e134a1c3b903ed38eb355fe4447690a10ed66
Author: Zhao Chao <email address hidden>
Date: Thu Mar 15 10:10:19 2018 +0800

    Fix str and dict usages in unittests for Python3

    - use six.text_type instead of unicode for assertion;
    - use dict.items() instead of dict.iteritems() for dict iteration;
    - use six.text_type to capture exception messages, the 'message' attribute
      is no longer existing;
    - dict.keys() returns a dict_keys object under Python3 which cannot be
      reversed, explicitly convert it to a list.

    Partial-Bug: #1755413

    Change-Id: I5d31397b7bfe08b504ee5b9cd4ff894031f66c2b
    Signed-off-by: Zhao Chao <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/553406
Committed: https://git.openstack.org/cgit/openstack/trove-dashboard/commit/?id=e5f00207f7ca4ab1fab1f733b2860b242b393035
Submitter: Zuul
Branch: master

commit e5f00207f7ca4ab1fab1f733b2860b242b393035
Author: Zhao Chao <email address hidden>
Date: Thu Mar 15 21:39:10 2018 +0800

    Use for loop instead of map to modify iterables

    Previously we use map() to apply changes to every item in a iterable
    object, but this is not a proper usage. And in Python3, map() will
    return a map iterator object, changes will not be applied immediately,
    as we're not iterating the map object, changes will never be applied.
    Changing to for loop instead fixes.

    Partial-Bug: #1755413

    Change-Id: Iebbfaca67cda72300636e51686bac3b1513b127d
    Signed-off-by: Zhao Chao <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/553428
Committed: https://git.openstack.org/cgit/openstack/trove-dashboard/commit/?id=721da6ac3e34f98606672c0f3f52a240e96cb860
Submitter: Zuul
Branch: master

commit 721da6ac3e34f98606672c0f3f52a240e96cb860
Author: Zhao Chao <email address hidden>
Date: Thu Mar 15 22:50:47 2018 +0800

    Avoid using hasattr() on troveclient resources for py3 porting

    troveclient resources use the lazy-loading feature, which causes problems
    for calling hasttr() on the object. copy.deepcopy() also use hasattr(),
    and results in infinite loops. hasattr() will ignore any exceptions under
    Python 2.x, but reraise them under Python 3, this is reason why the related
    test cases passed under Python 2.x and keep failing under Python 3. This
    patch fixes and should be the last one to fix the py35 gate jobs.

    Partial-Bug: #1755413

    Change-Id: I97492605047a986d3075a8b5f22ecbfdb3af8aca
    Signed-off-by: Zhao Chao <email address hidden>

Revision history for this message
Zhao Chao (zhaochao1984) wrote :
Changed in trove-dashboard:
status: In Progress → Fix Released
Revision history for this message
Fan Zhang (fanzhang) wrote :

Nice job!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove-dashboard (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/554680

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/554681

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/554682

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/554683

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove-dashboard (stable/queens)

Reviewed: https://review.openstack.org/554680
Committed: https://git.openstack.org/cgit/openstack/trove-dashboard/commit/?id=c230334e1068119f1c96ffbf35e4efdbe02c5c77
Submitter: Zuul
Branch: stable/queens

commit c230334e1068119f1c96ffbf35e4efdbe02c5c77
Author: Zhao Chao <email address hidden>
Date: Wed Mar 14 17:15:14 2018 +0800

    Fix binascii hexlify under Python 3

    Add wrapper functions for binascii hexlify/unhexlify to deal with the
    conversion between bytes and str.

    Partial-Bug: #1755413

    Change-Id: I8351b30b62ba19290e05c30499c3588649f8f367
    Signed-off-by: Zhao Chao <email address hidden>
    (cherry picked from commit a5cc40f488610694da92f6d8f86f83460dd2567c)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/554681
Committed: https://git.openstack.org/cgit/openstack/trove-dashboard/commit/?id=c51b3bbe830f1a22d40613bec2046e8c75dbf67e
Submitter: Zuul
Branch: stable/queens

commit c51b3bbe830f1a22d40613bec2046e8c75dbf67e
Author: Zhao Chao <email address hidden>
Date: Thu Mar 15 10:10:19 2018 +0800

    Fix str and dict usages in unittests for Python3

    - use six.text_type instead of unicode for assertion;
    - use dict.items() instead of dict.iteritems() for dict iteration;
    - use six.text_type to capture exception messages, the 'message' attribute
      is no longer existing;
    - dict.keys() returns a dict_keys object under Python3 which cannot be
      reversed, explicitly convert it to a list.

    Partial-Bug: #1755413

    Change-Id: I5d31397b7bfe08b504ee5b9cd4ff894031f66c2b
    Signed-off-by: Zhao Chao <email address hidden>
    (cherry picked from commit 996e134a1c3b903ed38eb355fe4447690a10ed66)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/554682
Committed: https://git.openstack.org/cgit/openstack/trove-dashboard/commit/?id=5001b8eaf2dae87cf5ec299964344d1d58b18908
Submitter: Zuul
Branch: stable/queens

commit 5001b8eaf2dae87cf5ec299964344d1d58b18908
Author: Zhao Chao <email address hidden>
Date: Thu Mar 15 21:39:10 2018 +0800

    Use for loop instead of map to modify iterables

    Previously we use map() to apply changes to every item in a iterable
    object, but this is not a proper usage. And in Python3, map() will
    return a map iterator object, changes will not be applied immediately,
    as we're not iterating the map object, changes will never be applied.
    Changing to for loop instead fixes.

    Partial-Bug: #1755413

    Change-Id: Iebbfaca67cda72300636e51686bac3b1513b127d
    Signed-off-by: Zhao Chao <email address hidden>
    (cherry picked from commit e5f00207f7ca4ab1fab1f733b2860b242b393035)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/554683
Committed: https://git.openstack.org/cgit/openstack/trove-dashboard/commit/?id=b3263223779d45377aa13906b8d4422d71e60c1b
Submitter: Zuul
Branch: stable/queens

commit b3263223779d45377aa13906b8d4422d71e60c1b
Author: Zhao Chao <email address hidden>
Date: Thu Mar 15 22:50:47 2018 +0800

    Avoid using hasattr() on troveclient resources for py3 porting

    troveclient resources use the lazy-loading feature, which causes problems
    for calling hasttr() on the object. copy.deepcopy() also use hasattr(),
    and results in infinite loops. hasattr() will ignore any exceptions under
    Python 2.x, but reraise them under Python 3, this is reason why the related
    test cases passed under Python 2.x and keep failing under Python 3. This
    patch fixes and should be the last one to fix the py35 gate jobs.

    Partial-Bug: #1755413

    Change-Id: I97492605047a986d3075a8b5f22ecbfdb3af8aca
    Signed-off-by: Zhao Chao <email address hidden>
    (cherry picked from commit 721da6ac3e34f98606672c0f3f52a240e96cb860)

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.