Public bug reported:

If you send an empty allocation list to the placement server:

- name: put an allocation empty list
  PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958
  request_headers:
      content-type: application/json
  data:
      allocations: []

You'll get a 500 response because of an Index error when consumer_id =
allocs[0].consumer_id.

Instead we should never reach this code. There should either be a schema
violation, because we should have at least one allocation, or if we're
willing to accept an empty list and do nothing, w should skip the call
to the database.

** Affects: nova
     Importance: Medium
     Assignee: Chris Dent (cdent)
         Status: Confirmed


** Tags: pike-rc-potential placment

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

Title:
  Sending empty allocations list on a PUT /allocations/{consumer_uuid}
  results in 500

Status in OpenStack Compute (nova):
  Confirmed

Bug description:
  If you send an empty allocation list to the placement server:

  - name: put an allocation empty list
    PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958
    request_headers:
        content-type: application/json
    data:
        allocations: []

  You'll get a 500 response because of an Index error when consumer_id =
  allocs[0].consumer_id.

  Instead we should never reach this code. There should either be a
  schema violation, because we should have at least one allocation, or
  if we're willing to accept an empty list and do nothing, w should skip
  the call to the database.

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to