yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #60105
[Bug 1652943] [NEW] api-ref: os-server-groups POST description is wrong for policies parameter
Public bug reported:
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.
** Affects: nova
Importance: Medium
Assignee: Matt Riedemann (mriedem)
Status: Triaged
** Tags: api-ref
** Changed in: nova
Assignee: (unassigned) => Matt Riedemann (mriedem)
--
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):
Triaged
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
Follow ups