v3 endpoint create should require url

Bug #1284422 reported by wanghong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
wanghong

Bug Description

When create a endpoint, if I do not specify "service_id" I will get the following reponse:
curl -i -H "X-Auth-Token:admin" -H "Content-Type:application/json" http://127.0.0.1:35357/v3/endpoints -d '{"endpoint":{"interface":"test"}}'

{"error": {"message": "service_id field is required and cannot be empty", "code": 400, "title": "Bad Request"}}openstack@openstack-HP-Compaq-8100-Elite-CMT-PC:~/devstack$

But, if I do not specify "url" I will get another reponse as following:
curl -i -H "X-Auth-Token:admin" -H "Content-Type:application/json" http://127.0.0.1:35357/v3/endpoints -d '{"endpoint":{"interface":"test","service_id":"d893b85ae4f842d5bb1727e271cf5be3"}}'

{"error": {"message": "An unexpected error prevented the server from fulfilling your request. (OperationalError) (1048, \"Column 'url' cannot be null\") 'INSERT INTO endpoint (id, legacy_endpoint_id, interface, region, service_id, url, extra) VALUES (%s, %s, %s, %s, %s, %s, %s)' ('57b1f66ed22f45c3ba43812d7eabac69', None, 'test', None, 'd893b85ae4f842d5bb1727e271cf5be3', None, '{}')", "code": 500, "title": "Internal Server Error"}}

The url parameter should be required too.

wanghong (w-wanghong)
Changed in keystone:
assignee: nobody → wanghong (w-wanghong)
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/76409
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=aabf0b525edc2e5063bdba72a33ea6db919423b6
Submitter: Jenkins
Branch: master

commit aabf0b525edc2e5063bdba72a33ea6db919423b6
Author: wanghong <email address hidden>
Date: Wed Feb 26 09:21:14 2014 +0800

    v3 endpoint create should require url

    The url parameter of endpoint object is not nullable in db, but we
    do not have a null check in api. So, when create a endpoint if I
    do not specify url parameter I will get a 500 reponse.
    This patch will add an attribute require check to url parameter.

    Change-Id: I9c8aa3bcb99ea5cb5e4e4d3306d8d222c6f074d1
    Closes-Bug: #1284422

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → icehouse-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-rc1 → 2014.1
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.