Enhance user input check in 'cinder type-key'

Bug #1508273 reported by Peter Wang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-cinderclient
Won't Fix
Undecided
Unassigned

Bug Description

When I tried to set extra specs for a volume type i used following:

       cinder type-key cgtype set test= aa

above format is not the allowed format(I typed an SPACE before 'aa'):

stack@ubuntu14:~/devstack$ cinder type-key
usage: cinder type-key <vtype> <action> <key=value> [<key=value> ...]

while cinderclient did not do format check and produced unexpected result:

stack@ubuntu14:~/devstack$ cinder extra-specs-list
+--------------------------------------+-------------+------------------------------------------+
| ID | Name | extra_specs |
+--------------------------------------+-------------+------------------------------------------+
| 9536cd2f-d336-4b5c-a572-b5a24c98a6b0 | cgtype | {u'test': u'', u'aa': None} |
+--------------------------------------+-------------+------------------------------------------+

what i want is {'test': 'aa'}

This behavior would cause confusion when user uses this type to create volume.

Thanks
Peter

Revision history for this message
Syed Ahsan Shamim Zaidi (ahsanmohsin04) wrote :

Hi Peter,

It is an error as you have said since there should not be any space, it should be test=aa.

However, did you tried cinder type-key cgtype set ['test'='aa'].
I dont think one can get the output other way, rather then u'xxx'

Let me know if it works.

Revision history for this message
Peter Wang (peter.wang) wrote :

actually, the space before aa is typo, but I did not get notified even if
 my format was wrong. finally, I got unexpected result as I mentioned.

my point is to do format check before writing to the database~~

thanks
peter

Changed in python-cinderclient:
assignee: nobody → Syed Ahsan Shamim Zaidi (ahsanmohsin04)
Changed in python-cinderclient:
status: New → In Progress
Revision history for this message
Peter Wang (peter.wang) wrote :

Is there any update for this bug?

Changed in python-cinderclient:
assignee: Syed Ahsan Shamim Zaidi (ahsanmohsin04) → nobody
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

There really isn't much that can be done about this since we don't know what your intention is when parsing the command input. As you saw, that input was valid. Just not what you had wanted to do.

Changed in python-cinderclient:
status: In Progress → Won't Fix
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.