Trove API create/update calls cannot have empty host strings

Bug #1214166 reported by Riddhi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Tim Simpson

Bug Description

The trove api create/update calls should throw a BadRequest in case of empty host strings.

For example:
In case of modify user attributes API,
if the client sends an empty host attribute, the API accepts it; however, the API will no longer find the user on the next requests.

Send an update containing an empty host:

$ curl \
    --request PUT "https://dfw.databases.api.rackspacecloud.com/v1.0/708784/instances/94db0f63-2423-454a-bb22-91dc444b60ef/users/gandalf" \
    --data "{ \"user\" : { \"host\": \"\" } }" \
    --header "Content-Type: application/json" \
    --header "X-Auth-Token: 7e08297922a245748b074d6142956709" \
    --insecure \
    --write-out "http_code=%{http_code}"

It returns 202.

If you try to update it again or delete the user, it returns:

{"itemNotFound": {"message": "User gandalf cannot be found on the instance.", "code": 404}}

This triggers the need to explicitly throw a BadRequest in case a empty host string is specified.

Riddhi (ridhi-j-shah)
Changed in trove:
assignee: nobody → Riddhi (ridhi-j-shah)
Riddhi (ridhi-j-shah)
Changed in trove:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/43005

Changed in trove:
milestone: none → havana-rc1
Changed in trove:
assignee: Riddhi (ridhi-j-shah) → Tim Simpson (tim-simpson)
Changed in trove:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/43005
Committed: http://github.com/openstack/trove/commit/926a5ea721f9b155ce3d074694075b742d8c3306
Submitter: Jenkins
Branch: master

commit 926a5ea721f9b155ce3d074694075b742d8c3306
Author: Riddhi Shah <email address hidden>
Date: Tue Aug 20 16:41:18 2013 -0500

    Modify User Attributes API - Fix

    This fix does not allow empty host strings in the update user call.
    Besides, it also enusres that database access is not lost during an update of the host attribute

    Change-Id: I57b7733c264d2bcd70dfea95f85aae68553c4dff
    Fixes: bug #1214166
    Fixes: bug #1214555

Changed in trove:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.