Reviewed: https://review.openstack.org/286526 Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=6c6151af8ee8c4f5170f95b862b2b5b78f7fff8a Submitter: Jenkins Branch: master
commit 6c6151af8ee8c4f5170f95b862b2b5b78f7fff8a Author: Niall Bunting <[email protected]> Date: Tue Mar 1 11:52:04 2016 +0000 Creating or updating a image member in a list causes 500 This change catches a type error that can be raised if a user mistakenly uses a list over a dict. This occurs in both adding a new member and updating a member that has already been added. This will cause a HTTPBadRequest to be raised with instructions how to fix the problem. Change-Id: I6af3e0ae45ee535859c4ad278ccf995643225585 Closes-Bug: 1551689 ** Changed in: glance Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to Glance. https://bugs.launchpad.net/bugs/1551689 Title: Adding member in a list causes 500 Status in Glance: Fix Released Bug description: Overview: One of the responses that wsgi returns reports: "Unexpected body type. Expected list/dict." I then tried supplying the new member as a list for it to fail. How to reproduce: The command: nib@VM:~/devstack/devstack$ curl -H "X-Auth-Token: $token" -X POST http://127.0.0.1:9292/v2/images/a394fe2a-bc8b-4485-9819-e264d278e45f/members -d '["f9544674f852450faf5b595a38f4e98f"]' <html> <head> <title>500 Internal Server Error</title> </head> <body> <h1>500 Internal Server Error</h1> The server has either erred or is incapable of performing the requested operation.<br /><br /> Partial stack trace: 2016-03-01 11:35:07.189 TRACE glance.common.wsgi File "/opt/stack/glance/glance/api/v2/image_members.py", line 249, in create 2016-03-01 11:35:07.189 TRACE glance.common.wsgi member_id = body['member'] 2016-03-01 11:35:07.189 TRACE glance.common.wsgi TypeError: list indices must be integers, not str Output: 500 Expected: 400 To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/1551689/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

