Folsom - Able to create flavor with invalid "is-public" parameter

Bug #1059414 reported by Rajalakshmi Ganesan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Russell Cloran
python-novaclient
Fix Released
Undecided
Russell Cloran

Bug Description

Description:
-------------------

We are able to create a flavor even if the "is-public" parameter is given invalid. It accepts value as False if junk value is given for "is-public" parameter.

Environment:
-----------------
Folsom

Actual Result:
-------------------
Accepted as option "False" when invalid characters are given.

Expected Result:
-----------------------

Should give an error message stating that the "is-public" parameter can be either "True" or "False"

CURL COMMANDS:
-----------------------------

rajalakshmi_ganesan@ubuntu:~/source/csbu-qa/AutomatedTests/python_tests/hp_regression/nova/nova_api_tests/flavors$ curl -i http://15.184.64.226:8774/v2/30832a492d3548918482624bd4bbc00f/flavors -X POST -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 6949797cc5264108bdede64013309177" -d '{"flavor": {"vcpus": 4, "ram": "512", "name": "invalid_ram_flavor27655", "os-flavor-access:is_public": "@#$%!^&*())_+:<>?sss", "rxtx_factor": 2, "OS-FLV-EXT-DATA:ephemeral": 2, "disk": 2, "id": 25340, "swap": 512}}'
HTTP/1.1 200 OK
X-Compute-Request-Id: req-9739d88c-86b0-4ea6-bb17-4588b16f5472
Content-Type: application/json
Content-Length: 452
Date: Mon, 01 Oct 2012 07:21:56 GMT

{"flavor": {"name": "invalid_ram_flavor27655", "links": [{"href": "http://15.184.64.226:8774/v2/30832a492d3548918482624bd4bbc00f/flavors/25340", "rel": "self"}, {"href": "http://15.184.64.226:8774/30832a492d3548918482624bd4bbc00f/flavors/25340", "rel": "bookmark"}], "ram": 512, "OS-FLV-DISABLED:disabled": false, "vcpus": 4, "swap": 512, "os-flavor-access:is_public": false, "rxtx_factor": 2, "OS-FLV-EXT-DATA:ephemeral": 2, "disk": 2, "id": "25340"}}rajalakshmi_ganesan@ubuntu:~/source/csbu-qa/AutomatedTests/python_tests/hp_regression/nova/nova_api_tests/flavors$

PYTHON NOVA-CLIENT COMMAND:
--------------------------------------------------

rajalakshmi_ganesan@ubuntu:~/source/csbu-qa/AutomatedTests/python_tests/hp_regression/nova/nova_api_tests/flavors$ nova flavor-create test-1 335533 512 2 4 --is-public "invalid_option"
+--------+--------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+--------+--------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 335533 | test-1 | 512 | 2 | 0 | | 4 | 1 | False | {} |
+--------+--------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
rajalakshmi_ganesan@ubuntu:~/source/csbu-qa/AutomatedTests/python_tests/hp_regression/nova/nova_api_tests/flavors$

Russell Cloran (russell)
Changed in python-novaclient:
assignee: nobody → Russell Cloran (russell)
Russell Cloran (russell)
Changed in nova:
assignee: nobody → Russell Cloran (russell)
Russell Cloran (russell)
Changed in nova:
status: New → In Progress
Changed in python-novaclient:
status: New → In Progress
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/15055

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/15056
Committed: http://github.com/openstack/python-novaclient/commit/7bf93a52f8828822c8949fe66bc79e8c035d1330
Submitter: Jenkins
Branch: master

commit 7bf93a52f8828822c8949fe66bc79e8c035d1330
Author: Russell Cloran <email address hidden>
Date: Mon Oct 29 23:09:26 2012 -0700

    Validate that boolean parameters are boolean

    Ensure that values which are supposed to be boolean look like correct
    user input, instead of assuming that any non true-looking input is
    False.

    Also, update the flavor manager to raise a CommandError if is_public is
    not a boolean value.

    Fixes bug 1059414

    Change-Id: I3275e4bba103b14081becf91f723f1be060391e5

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

Reviewed: https://review.openstack.org/15055
Committed: http://github.com/openstack/nova/commit/36f47b8a88a6a8804177245cb994644423b63225
Submitter: Jenkins
Branch: master

commit 36f47b8a88a6a8804177245cb994644423b63225
Author: Russell Cloran <email address hidden>
Date: Mon Oct 29 22:09:14 2012 -0700

    Validate is-public parameter to flavor creation

    Check that the is-public parameter to flavor creation is either a
    boolean or a string representing a boolean, and raise an error
    otherwise.

    Fixes bug 1059414

    Change-Id: Ic0764f0ee407d40bb5d14c1e92de4bf033bd657f

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