extra_specs should not allow a key '=123'

Bug #1292316 reported by jichenjc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
jichenjc

Bug Description

[root@controller ~]# nova flavor-key 21 set =984 =1231
[root@controller ~]# nova flavor-show 21
+----------------------------+------------------------------+
| Property | Value |
+----------------------------+------------------------------+
| name | m2.test4 |
| ram | 512 |
| OS-FLV-DISABLED:disabled | False |
| vcpus | 1 |
| extra_specs | {u'': u'1231', u'nec1': u''} |
| swap | 512 |
| os-flavor-access:is_public | True |
| rxtx_factor | 1.0 |
| OS-FLV-EXT-DATA:ephemeral | 4 |
| disk | 1 |
| id | 21 |
+----------------------------+------------------------------+

which indicates a key = NULL existing

Tags: api
jichenjc (jichenjc)
Changed in nova:
assignee: nobody → jichencom (jichenjc)
Tracy Jones (tjones-i)
tags: added: api
Revision history for this message
Christopher Yeoh (cyeoh-0) wrote :

Yes we really should be doing a lot more filtering at the API level. Have to be careful to retain backwards compatibility for the V2 API though which largely means we can only fix this for the v3 api.

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
reachlin (reachlin) wrote :

I couldn't reproduce this.
$nova flavor-key 1 set =984 =1231
ERROR: Invalid key: "". Keys may only contain....

Revision history for this message
jichenjc (jichenjc) wrote :

Guess I am not using latest nova client....
I will try to use latest one again

but after code review, looks to me we still need enhancement on nova since not only CLI will access nova API layer

Revision history for this message
jichenjc (jichenjc) wrote :

um... I think I need to modify the title of this defect into 'add test for validate_extra_spec_keys functions'
since looks to me my env is not - up - to -date, sorry for the noise here
but I found no test for the function, so I will add it

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

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

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

Reviewed: https://review.openstack.org/83284
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a43d5ea900d56d26b07a9959ce1834a67d47c2ec
Submitter: Jenkins
Branch: master

commit a43d5ea900d56d26b07a9959ce1834a67d47c2ec
Author: jichenjc <email address hidden>
Date: Tue Mar 25 07:21:04 2014 +0800

    Add test cases for validate_extra_spec_keys

    There is no unit test cases for function flavors.validate_extra_spec_keys,
    this patch adds for it

    Change-Id: I689aad1ce7428687c723ecd2eba243fccb3342bf
    Closes-Bug: #1292316

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
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.