Cannot search volumes by meta-data

Bug #1195015 reported by Mathieu Gagné on 2013-06-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
Seif Lotfy

Bug Description

The metadata parameter is urlencoded (to string) by cinderclient but isn't decoded back to dict by the API.

This prevents the search of volumes by meta-data.

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

Changed in cinder:
assignee: nobody → Mathieu Gagné (mgagne)
status: New → In Progress
Mathieu Gagné (mgagne) wrote :

I wish this bugfix to be backported to Grizzly.

Mathieu Gagné (mgagne) on 2013-07-09
Changed in python-cinderclient:
assignee: nobody → Mathieu Gagné (mgagne)
Seif Lotfy (seif) wrote :

Are you still working on it or can I take over? I have a working which uses your unit tests :D

Mathieu Gagné (mgagne) wrote :

Sorry for the delay. I'm about to propose a new approach. Feel free to comment or challenge my proposition.

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

Changed in python-cinderclient:
status: New → In Progress

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

Changed in cinder:
assignee: Mathieu Gagné (mgagne) → Seif Lotfy (seif)
Seif Lotfy (seif) wrote :

Hey Mathieu,
Thanks a lot for taking up on this, I also think search volumes by meta-data is a crucial feature.
That being said I would like to challenge your approach to this.

sending 'metadata': {'tag': 'looloo', 'desc': 'foobar'}
should be encoded to
?metadata=%7B%27tag%27%3A+%27looloo%27%2C+%27desc%27%3A+%27foobar%27%7D

What is wrong with that. It is easy translated back and the cinder side can handle it
What am I missing

Reviewed: https://review.openstack.org/38062
Committed: http://github.com/openstack/cinder/commit/76fc407382315a97cc020e8592199609b3a6a8e9
Submitter: Jenkins
Branch: master

commit 76fc407382315a97cc020e8592199609b3a6a8e9
Author: Mathieu Gagné <email address hidden>
Date: Wed Jun 26 16:27:43 2013 -0400

    Fix volumes search by metadata

    The metadata parameter is urlencoded (to string) by cinderclient
    but isn't decoded back to dict by the API.

    The metadata parameter needs to be converted back to dict
    to be of any use by the filters parameter of get_all().

    The original implementation has been done by:
    Mathieu Gagne <email address hidden>

    Fixes: bug #1195015

    Change-Id: I19d7d386afddddc067e9f4ef86967c9b72d9e530

Changed in cinder:
status: In Progress → Fix Committed
Mathieu Gagné (mgagne) on 2013-07-26
no longer affects: python-cinderclient
Thierry Carrez (ttx) on 2013-09-05
Changed in cinder:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers