nova flavor-create return empty string when swap == 0

Bug #1408954 reported by Rui Chen
28
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Expired
Undecided
Unassigned

Bug Description

The type of 'swap' is string or int according to 'swap' value in DB.
swap == 0, return empty string.
swap > 0, return int.
The client code is complex when return value of API is not fixed type.
On the other hand, the type of 'swap' in the request and response of flavor-create should be same type.

DEBUG (session:169) REQ: curl -g -i -X POST http://10.250.10.29:8774/v2/e159961712f64b388b57062483d98a91/flavors -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}6ba0b4e647a5ca47937c48941ad361d02d4ff604" -d '{"flavor": {"vcpus": 1, "disk": 1, "name": "chenrui_f", "os-flavor-access:is_public": true, "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "ram": 1, "id": "11", "swap": 0}}'
INFO (connectionpool:188) Starting new HTTP connection (1): 10.250.10.29
DEBUG (connectionpool:364) "POST /v2/e159961712f64b388b57062483d98a91/flavors HTTP/1.1" 200 425
DEBUG (session:197) RESP: [200] date: Fri, 09 Jan 2015 09:36:44 GMT connection: keep-alive content-type: application/json content-length: 425 x-compute-request-id: req-df79ffc1-08ff-4569-945f-4fa2fdf49436
RESP BODY: {"flavor": {"name": "chenrui_f", "links": [{"href": "http://10.250.10.29:8774/v2/e159961712f64b388b57062483d98a91/flavors/11", "rel": "self"}, {"href": "http://10.250.10.29:8774/e159961712f64b388b57062483d98a91/flavors/11", "rel": "bookmark"}], "ram": 1, "OS-FLV-DISABLED:disabled": false, "vcpus": 1, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 1, "id": "11"}}

mysql> select * from instance_types where flavorid=11;
+---------------------+------------+------------+-----------+----+-----------+-------+------+-------------+----------+-------------+---------+--------------+----------+-----------+---------+
| created_at | updated_at | deleted_at | name | id | memory_mb | vcpus | swap | vcpu_weight | flavorid | rxtx_factor | root_gb | ephemeral_gb | disabled | is_public | deleted |
+---------------------+------------+------------+-----------+----+-----------+-------+------+-------------+----------+-------------+---------+--------------+----------+-----------+---------+
| 2015-01-09 09:36:44 | NULL | NULL | chenrui_f | 9 | 1 | 1 | 0 | NULL | 11 | 1 | 1 | 0 | 0 | 1 | 0 |
+---------------------+------------+------------+-----------+----+-----------+-------+------+-------------+----------+-------------+---------+--------------+----------+-----------+---------+
1 row in set (0.00 sec)

Rui Chen (kiwik-chenrui)
Changed in nova:
assignee: nobody → Rui Chen (kiwik-chenrui)
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/146050

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Joe Gordon (<email address hidden>) on branch: master
Review: https://review.openstack.org/146050
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in nova:
assignee: Rui Chen (kiwik-chenrui) → nobody
status: In Progress → Confirmed
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote : Cleanup EOL bug report

This is an automated cleanup. This bug report has been closed because it
is older than 18 months and there is no open code change to fix this.
After this time it is unlikely that the circumstances which lead to
the observed issue can be reproduced.

If you can reproduce the bug, please:
* reopen the bug report (set to status "New")
* AND add the detailed steps to reproduce the issue (if applicable)
* AND leave a comment "CONFIRMED FOR: <RELEASE_NAME>"
  Only still supported release names are valid (LIBERTY, MITAKA, OCATA, NEWTON).
  Valid example: CONFIRMED FOR: LIBERTY

Changed in nova:
importance: Low → Undecided
status: Confirmed → Expired
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.