Relaxed validation for v2 doesn't accept null for user_data like legacy v2 does (liberty)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Alex Xu | ||
Liberty |
Fix Released
|
High
|
Matt Riedemann | ||
Mitaka |
Fix Released
|
High
|
Matt Riedemann |
Bug Description
Description
===========
When moving to the relaxed validation [1] implementation of the v2 API under the v2.1 code base, a 'nova boot' request with "user_data": null fails with the error:
Returning 400 to user: Invalid input for field/attribute user_data. Value: None. None is not of type 'string'
Under the legacy v2 code base, such a request is allowed.
Steps to reproduce
==================
Using the legacy v2 code base under Liberty, make a nova boot call using the following json payload:
{
"server": {
"name": "mgdlibertyBBC",
"flavorRef": "1",
"imageRef": "626ce751-
"user_data": null,
"metadata": {
"created_by": "mdorman"
},
"security_
{
"name": "default"
}
],
"availabili
"key_name": "lm126135-mdorm"
}
}
The request succeeds and the instance is created.
However, using the v2 implementation from the v2.1 code base with the same json payload fails:
2016-05-17 12:47:02.336 18296 DEBUG nova.api.
Expected result
===============
The behavior of the v2 API in the v2.1 code base should be exactly the same as the legacy v2 code base.
Actual result
=============
Request fails under v2.1 code base, but succeeds under legacy v2 code base.
Environment
===========
Liberty, 12.0.3 tag (stable/liberty branch on 4/13/2016. Latest commit 6fdf1c87b1149e8
Logs & Configs
==============
Paste config used for legacy v2 code base (request succeeds):
[composite:
use = call:nova.
/v1.1: openstack_
/v2: openstack_
/v2.1: openstack_
Paste config used for v2.1 code base (request fails):
[composite:
use = call:nova.
/: oscomputeversions
/v1.1: openstack_
/v2: openstack_
/v2.1: openstack_
[1] http://
description: | updated |
tags: | added: api |
tags: | added: liberty-backport-potential |
summary: |
Relaxed validation for v2 doesn't accept null for user_data like legacy - v2 does + v2 does (liberty) |
Changed in nova: | |
assignee: | nobody → Alex Xu (xuhj) |
Looks like it's still an issue for v2.1 in Newton, we have no compat mode check for this it looks like:
https:/ /github. com/openstack/ nova/blob/ master/ nova/api/ openstack/ compute/ schemas/ user_data. py