← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1582911] Re: Relaxed validation for v2 doesn't accept null for user_data like legacy v2 does (liberty)

 

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

** Changed in: nova
       Status: New => Confirmed

** Also affects: nova/mitaka
   Importance: Undecided
       Status: New

** Also affects: nova/liberty
   Importance: Undecided
       Status: New

** Changed in: nova
   Importance: Undecided => High

** Changed in: nova/liberty
   Importance: Undecided => High

** Changed in: nova/mitaka
   Importance: Undecided => High

** Changed in: nova/liberty
       Status: New => Confirmed

** Changed in: nova/mitaka
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1582911

Title:
  Relaxed validation for v2 doesn't accept null for user_data like
  legacy v2 does (liberty)

Status in OpenStack Compute (nova):
  Confirmed
Status in OpenStack Compute (nova) liberty series:
  Confirmed
Status in OpenStack Compute (nova) mitaka series:
  Confirmed

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-744f-4830-9d38-5e9e4f70fe3f",
      "user_data": null,
      "metadata": {
        "created_by": "mdorman"
      },
      "security_groups": [
        {
          "name": "default"
        }
      ],
      "availability_zone": "glbt1-dev-lab-zone-1,glbt1-dev-lab-zone-2,",
      "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.openstack.wsgi [req-
  6d5d4100-7c0c-4ffa-a40c-4a086a473293 mdorman
  40e94f951b704545885bdaa987a25154 - - -] Returning 400 to user: Invalid
  input for field/attribute user_data. Value: None. None is not of type
  'string' __call__ /usr/lib/python2.7/site-
  packages/nova/api/openstack/wsgi.py:1175

  
  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 6fdf1c87b1149e8b395eaa9f4cbf27263cf96ac6)

  
  Logs & Configs
  ==============
  Paste config used for legacy v2 code base (request succeeds):

  [composite:osapi_compute]
  use = call:nova.api.openstack.urlmap:urlmap_factory
  /v1.1: openstack_compute_api_legacy_v2
  /v2: openstack_compute_api_legacy_v2
  /v2.1: openstack_compute_api_v21

  Paste config used for v2.1 code base (request fails):

  [composite:osapi_compute]
  use = call:nova.api.openstack.urlmap:urlmap_factory
  /: oscomputeversions
  /v1.1: openstack_compute_api_v21_legacy_v2_compatible
  /v2: openstack_compute_api_v21_legacy_v2_compatible
  /v2.1: openstack_compute_api_v21

  
  [1]  http://specs.openstack.org/openstack/nova-specs/specs/liberty/implemented/api-relax-validation.html

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1582911/+subscriptions


References