nova flavor-create return empty string when swap == 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
New
|
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://
INFO (connectionpool
DEBUG (connectionpool
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-
RESP BODY: {"flavor": {"name": "chenrui_f", "links": [{"href": "http://
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)