Internal file cache breaks with unicode keys

Bug #1492205 reported by Florian Fuchs
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-ironicclient
Fix Released
Undecided
SHIGEMATSU Mitsuhiro

Bug Description

ironicclient uses an internal file cache (dogpile.cache), with bdm as backend -- which in py2 uses the bsddb package from the standardlib. However, bsddb doesn't accept unicode as keys and raises a TypeError. For example if the ironic_url argument passed to client.get_client is a unicode string, which is then used as part of the cache key).

Proposed fix:

dogpile.cache provides a "key_mangler" config param to use in combination with the bsddb backend which solves this issue.

Changed in python-ironicclient:
assignee: nobody → Florian Fuchs (flo-fuchs)
assignee: Florian Fuchs (flo-fuchs) → nobody
assignee: nobody → Florian Fuchs (flo-fuchs)
status: New → In Progress
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-ironicclient (master)

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

Changed in python-ironicclient:
assignee: Florian Fuchs (flo-fuchs) → SHIGEMATSU Mitsuhiro (pshige)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-ironicclient (master)

Reviewed: https://review.openstack.org/220475
Committed: https://git.openstack.org/cgit/openstack/python-ironicclient/commit/?id=8fa6d32fbeeb5d990bd7f1c027e3de5b993b50ac
Submitter: Jenkins
Branch: master

commit 8fa6d32fbeeb5d990bd7f1c027e3de5b993b50ac
Author: Florian Fuchs <email address hidden>
Date: Fri Sep 4 13:53:23 2015 +0200

    Fixes file cache TypeError

    The internal cache (common.filecache) uses dogpile.cache's dbm backend,
    which uses the bsddb package from the standardlib (in py2 only). bsddb
    however breaks with a TypeError if the cache key is a unicode string.

    This change fixes this by using the ``key_mangler`` arg on cache
    creation, which (according to the dogpile.cache docs) is to be used with
    dbm/bsddb.

    Change-Id: Ie4911e31567d773357da99af3ded0548ad0b7db1
    Closes-Bug: #1492205

Changed in python-ironicclient:
status: In Progress → Fix Committed
Changed in python-ironicclient:
milestone: none → 0.8.1
status: Fix Committed → Fix Released
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.