Failover segment description doesn't accept multiline characters

Bug #1776385 reported by Tushar Patil on 2018-06-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
masakari
Undecided
SamP

Bug Description

If user passes description in multi-line characters, then it raises 400 error.

$curl -g -i -X POST http://172.16.159.137/instance-ha/v1/14de0d327c5244ea9cb85ca24843e44c/segments -H "Content-Type: application/json" -H "User-Agent: osc-lib/1.10.0 keystoneauth1/3.7.0 python-requests/2.18.4 CPython/2.7.12" -H "X-Auth-Token: gAAAAABbHz8RQDYHeBOL2-NariYUzBSBUkPPBvDoEPZ9L7gIxxLbsndNlctfMzOqkH1VYIO3SCYaMuUSbxVuOolJZjBtDpK7o32wpcf61-tK-iqs2jxNaJrOAIB4jR7DUx2GgBjqe0_ZREdILWRctG5drvJfb-BjRexUe3xGWQU8k6hmDbG0RCE" -d '{"segment": {"service_type": "compute", "recovery_method": "auto", "name": "tsting1", "description": "one\r\ntwo\r\n"}}'

HTTP/1.1 400 Bad Request
Date: Tue, 12 Jun 2018 03:34:25 GMT
Server: Apache/2.4.18 (Ubuntu)
OpenStack-API-Version: masakari 1.0
Vary: OpenStack-API-Version
Content-Type: application/json; charset=UTF-8
Content-Length: 8543
x-openstack-request-id: req-7bbac51a-dea3-41c9-977f-650e2dea29cd
Connection: close

{"badRequest": {"message": "Invalid input for field/attribute description. Value: tsting\r\neerewr\r\n.u'tsting\\r\\neerewr\\r\\n' does not match u'^[\\\\ -\\\\~\\\\\\xa0-\\\\\\xac\\\\\\xae-\\\\\\u0377\\\\\\u037a-\\\\\\u037e\\\\\\u0384-\\\\\\u038a\\\\\\u038c\\\\\\u038e-\\\\\\u03a1\\\\\\u03a3-\\\\\\u0525\\\\\\u0531-\\\\\\u0556\\\\\\u0559-\\\\\\u055f\\\\\\u0561-\\\\\\u0587\\\\\\u0589-\\\\\\u058a\\\\\\u0591-\\\\\\u05c7\\\\\\u05d0-\\\\\\u05ea\\\\\\u05f0-\\\\\\u05f4\\\\\\u0606-\\\\\\u061b\\\\\\u061e-\\\\\\u061f\\\\\\u0621-\\\\\\u065e\\\\\\u0660-\\\\\\u06dc\\\\\\u06de-\\\\\\u070d\\\\\\u0710-\\\\\\u074a\\\\\\u074d-\\\\\\u07b1\\\\\\u07c0-\\\\\\u07fa\\\\\\u0800-\\\\\\u082d\\\\\\u0830-\\\\\\u083e\\\\\\u0900-\\\\\\u0939\\\\\\u093c-\\\\\\u094e\\\\\\u0950-\\\\\\u0955\\\\\\u0958-\\\\\\u0972\\\\\\u0979-\\\\\\u097f\\\\\\u0981-\\\\\\u0983\\\\\\u0985-\.............}

Expected Result : 200 OK
Actual Result : 400 badRequest

Niraj Singh (nirajsingh) on 2018-06-12
Changed in masakari:
assignee: nobody → Niraj Singh (nirajsingh)
status: New → In Progress
Changed in masakari:
assignee: Niraj Singh (nirajsingh) → SamP (sampath-priyankara)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers