Internal file cache breaks with unicode keys

Bug #1492205 reported by Florian Fuchs on 2015-09-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fix Released

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
Changed in python-ironicclient:
assignee: Florian Fuchs (flo-fuchs) → SHIGEMATSU Mitsuhiro (pshige)

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

    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  Edit
Everyone can see this information.

Other bug subscribers