Volume type or nova flavor extra_spec containing '/' can't be deleted

Bug #1259711 reported by Eric Harney
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Alejandro Emanuel Paredes

Bug Description

Written based on Nova bug 1256119.

It is possible to set an extra spec for a volume type containing a '/' that then cannot be deleted.

$ cinder type-create test
+--------------------------------------+------+
| ID | Name |
+--------------------------------------+------+
| ff8b49fb-3883-428e-a942-61fa34633c23 | test |
+--------------------------------------+------+
$ cinder type-key test set 'a/b=c'
$ cinder extra-specs-list
+--------------------------------------+------+----------------+
| ID | Name | extra_specs |
+--------------------------------------+------+----------------+
| ff8b49fb-3883-428e-a942-61fa34633c23 | test | {u'a/b': u'c'} |
+--------------------------------------+------+----------------+
$ cinder --debug type-key test unset 'a/b'

...snip...

REQ: curl -i http://192.168.122.100:8776/v2/b3d6b9a5b8f04df08bf33714fe99d52a/types/ff8b49fb-3883-428e-a942-61fa34633c23/extra_specs/a/b -X DELETE -H "X-Auth-Project-Id: demo" -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: MI...ITF"

DEBUG:cinderclient.client:
REQ: curl -i http://192.168.122.100:8776/v2/b3d6b9a5b8f04df08bf33714fe99d52a/types/ff8b49fb-3883-428e-a942-61fa34633c23/extra_specs/a/b -X DELETE -H "X-Auth-Project-Id: demo" -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: MI...ITF"

RESP: [404] CaseInsensitiveDict({'date': 'Tue, 10 Dec 2013 22:07:01 GMT', 'content-length': '52', 'content-type': 'text/plain; charset=UTF-8'})
RESP BODY: 404 Not Found

The resource could not be found.

DEBUG:cinderclient.client:RESP: [404] CaseInsensitiveDict({'date': 'Tue, 10 Dec 2013 22:07:01 GMT', 'content-length': '52', 'content-type': 'text/plain; charset=UTF-8'})
RESP BODY: 404 Not Found

The resource could not be found.

ERROR: Not found (HTTP 404)

Revision history for this message
Shree Duth Awasthi (shreeduth-awasthi) wrote :

Shall we go the other way round by not allowing the "/" to be included in volume type extra_spec ?

Though I believe that Matt Riedemann suggestion is good enough for nova.

Please correct, if my understanding is incorrect.

Revision history for this message
Mike Perez (thingee) wrote :

Yes, we should be checking that it's alphanumeric, dashes, periods, underscores and spaces as nova is.

Changed in cinder:
assignee: nobody → Shree Duth Awasthi (shreeduth-awasthi)
Changed in cinder:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → icehouse-2
Rushi Agrawal (rushiagr)
summary: - Volume type extra_spec containing '/' can't be deleted
+ Volume type or image flavor extra_spec containing '/' can't be deleted
Rushi Agrawal (rushiagr)
summary: - Volume type or image flavor extra_spec containing '/' can't be deleted
+ Volume type or nova flavor extra_spec containing '/' can't be deleted
Changed in cinder:
assignee: Shree Duth Awasthi (shreeduth-awasthi) → nobody
Changed in cinder:
assignee: nobody → Alejandro Emanuel Paredes (alejandro-e-paredes)
Changed in cinder:
milestone: icehouse-2 → icehouse-3
Revision history for this message
Rushi Agrawal (rushiagr) wrote :

Skipped reading the first line of bug description, that there is already a bug registered against Nova.

no longer affects: nova
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/68477
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=5ec6f8f8e8b88f48300e66369840c2fafd06f4c5
Submitter: Jenkins
Branch: master

commit 5ec6f8f8e8b88f48300e66369840c2fafd06f4c5
Author: Alejandro Emanuel Paredes <email address hidden>
Date: Wed Jan 22 15:19:19 2014 -0500

    Extra_spec containing '/' can't be deleted

    This patch validates the keys of the extra specs
    before setting them.
    This will make possible to remove those keys.
    It allows alphanumeric characters, underscores,
    periods, colons and hyphens.

    Change-Id: Ic2e5d7ce42c8ecb7ee45cd168bd008035fd4bbdf
    Closes-Bug: #1259711

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: icehouse-3 → 2014.1
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.