← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1652943] Re: api-ref: os-server-groups POST description is wrong for policies parameter

 

Reviewed:  https://review.openstack.org/415482
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0a3f5dca2ca8c0316f0a4d8eb9cb378c52102e87
Submitter: Jenkins
Branch:    master

commit 0a3f5dca2ca8c0316f0a4d8eb9cb378c52102e87
Author: Matt Riedemann <mriedem@xxxxxxxxxx>
Date:   Wed Dec 28 10:06:40 2016 -0500

    api-ref: cleanup os-server-groups 'policies' parameter description
    
    The 'policies' parameter for the os-server-groups API is an array
    for legacy reasons, but the schema validation allows only a single
    item and it's from the enumerated list, and exactly one must be
    specified when creating a server group.
    
    This patch cleans up the policies parameter description to avoid
    confusion over the number of items that can be specified or their
    form, and it also provides a description of each available policy.
    
    Since the jsonschema for policies is a bit confusing too, this
    patch adds a comment in the schema code to avoid future confusion
    over how the validation works.
    
    Change-Id: I3ab2880ed6e8bb2cdf476c197719b83d768d44d0
    Closes-Bug: #1652943


** Changed in: nova
       Status: In Progress => Fix Released

-- 
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/1652943

Title:
  api-ref: os-server-groups POST description is wrong for policies
  parameter

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  The API reference for creating a server group has some misleading text
  in the description of the policies parameter:

  http://developer.openstack.org/api-ref/compute/?expanded=create-
  server-group-detail

  It says "A list of one or more policy names to associate with the
  server group." However, it actually can only be exactly one value
  based on how the schema works:

                  'policies': {
                      'type': 'array',
                      'items': [{'enum': ['anti-affinity', 'affinity']}],
                      'uniqueItems': True,
                      'additionalItems': False,
                  }

  additionalItems=False means you can only have a single item for the
  policies value. As seen here:

  stack@filters:~$ nova server-group-create conflicting-policy-server-group affinity anti-affinity
  ERROR (BadRequest): Invalid input for field/attribute policies. Value: [u'affinity', u'anti-affinity']. Additional items are not allowed (u'anti-affinity' was unexpected) (HTTP 400) (Request-ID: req-3b2c8b4b-0080-4c26-83dd-a3c5db748beb)

  The API reference also says:

  "Each policy name must be a non-empty string with no leading or
  trailing spaces. Maximum length is 255 characters."

  This is pointless to mention since the policies value is validated
  against an enumerated list of possible values.

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


References