Use textwrap instead of home made implementation

Bug #1404402 reported by Cedric Brandily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Fix Released
Wishlist
Cedric Brandily

Bug Description

Currently python-keystoneclient uses a homemade implementation in token_to_cms to wrap token to 64 characters per line. We should use python standard lib implementation (textwrap) instead

Changed in python-keystoneclient:
assignee: nobody → Cedric Brandily (cbrandily)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/139032
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=4350c176048b8d159d08b82b915e9544ac9dee6f
Submitter: Jenkins
Branch: master

commit 4350c176048b8d159d08b82b915e9544ac9dee6f
Author: Cedric Brandily <email address hidden>
Date: Thu Dec 4 13:06:08 2014 +0100

    Use textwrap instead of home made implementation

    This change replaces a home made text wrapper by textwrap module. It is
    a non-functional change which is covered by existing tests.

    Closes-Bug: #1404402
    Change-Id: I5cc4da61205f64b478366c29e6d7ff9929ad4d16

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Changed in python-keystoneclient:
milestone: none → 1.1.0
Changed in python-keystoneclient:
importance: Undecided → Wishlist
Changed in python-keystoneclient:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-keystoneclient (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/252355

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/252355
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=fde0bf77d6a89ee84e62461bc0d4c2cdfd809c48
Submitter: Jenkins
Branch: master

commit fde0bf77d6a89ee84e62461bc0d4c2cdfd809c48
Author: Bernhard M. Wiedemann <email address hidden>
Date: Wed Dec 2 12:47:33 2015 +0100

    Replace textwrap with fast standard code

    This improves on commit 4350c176048b8d159d08b82b915e9544ac9dee6f

    We found a major performance regression in keystoneclient
    when using PKI tokens, related to http://bugs.python.org/issue25870

    It can be tested with
    time python -c "import textwrap; textwrap.wrap('x'*9000, 64)"

    which has a complexity of O(n*n)
    because it uses certain regexps in python versions before 3.5.

    Closes-Bug: #1526686
    Related-Bug: #1404402

    Change-Id: Ibc81907c4d9db2c09fff41ccf21345fbdb19202d

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.