Reviewed: https://review.openstack.org/306424 Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=6e10f1b4c90e444c8978e4b3cfe650dc0fc810fc Submitter: Jenkins Branch: master
commit 6e10f1b4c90e444c8978e4b3cfe650dc0fc810fc Author: bhagyashris <[email protected]> Date: Thu Mar 24 10:01:59 2016 +0000 Return BadRequest for 4 byte unicode characters Various create and update apis are returning 500 error when you pass 4 byte unicode characters in the request. This patch fixes the issue to return HTTP 400 Bad Request. 1. md-namespace-create 2. md-namespace-update 3. md-property-create 4. md-property-update 5. md-object-create 6. md-object-update 7. md-tag-create 8. md-tag-update APIImpact: For all of the above APIs, it will return 400 error instead of 500 if user passes 4 byte unicode characters in the request. Closes-Bug: #1570789 Change-Id: I8233cf95310aa2671ebc62995c58208024fc38a3 ** 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/1570789 Title: various md-* create and update api's return 500 error if 4 bytes unicode characters is passed Status in Glance: Fix Released Bug description: md-* create and update apis are returning 500 error when you pass 4 bytes unicode characters in the request. Steps to reproduce: $ glance md-object-create --schema '{}' --name 🚓 <namespace> or $ curl -g -i -X POST http://172.31.21.75:9292/v2/metadefs/namespaces/OS::Glance::CommonImageProperties/objects -H "User-Agent: python-glanceclient" -H "Content-Type: application/json" -H "X-Auth-Token: 79e33042569e4c128945d623c3228ca6" -d '{"name": "\ud83d\ude93"}' Result: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 595, in main args.func(client, args) File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", line 898, in do_md_tag_update **fields) File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/metadefs.py", line 461, in update self.http_client.put(url, data=tag) File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", line 185, in put return self.request(url, 'PUT', **kwargs) File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 332, in request return self._handle_response(resp) File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 83, in _handle_response raise exc.from_response(resp, resp.content) HTTPInternalServerError: 500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500) 500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500) List of APIs failing: 1. md-namespace-create 2. md-namespace-update 3. md-property-create 4. md-property-update 5. md-object-create 6. md-object-update 7. md-tag-create 8. md-tag-update To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/1570789/+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

