None value allowed for port parameter in legacy v2 API, but not allowed in v2.1 API
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Alex Xu |
Bug Description
In the legacy v2 API, we create server with network like this:
"networks": [{"uuid": "f4001fde-
The port can be null.
With v2.1 API, you will get 400:
curl -g -i -X POST http://
HTTP/1.1 400 Bad Request
X-Openstack-
Vary: X-OpenStack-
Content-Type: application/json; charset=UTF-8
Content-Length: 117
X-Compute-
Date: Mon, 07 Mar 2016 13:01:58 GMT
{"badRequest": {"message": "Invalid input for field/attribute port. Value: None. None is not a 'uuid'", "code": 400}}
This is due to we write json-schema like this:
'port': {
'type': ['string', 'null'],
format': 'uuid'
},
We assume 'type' will enable 'null' value and 'format' only against on string type. Actually 'null' will be passed to format check also, then the format check return fault.
The discussion on the ML http:// lists.openstack .org/pipermail/ openstack- dev/2016- March/088514. html