null endpoints are not ignored by v3

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

Bug Description

The following command should create a single endpoint on v3 with a interface="public" and url="http://localhost:5000/"

$ keystone --debug --os-token=ADMIN --os-endpoint=http://localhost:35357/v2.0/ endpoint-create --region=north --service-id=239ff97ce7a14e2b92b7a513d1bb243f --publicurl=http://localhost:5000/
REQ: curl -i http://localhost:35357/v2.0/endpoints -X POST -H "User-Agent: python-keystoneclient" -H "Content-Type: application/json" -H "X-Auth-Token: ADMIN"
REQ BODY: {"endpoint": {"adminurl": null, "service_id": "239ff97ce7a14e2b92b7a513d1bb243f", "region": "north", "internalurl": null, "publicurl": "http://localhost:5000/"}}

RESP: [200] {'date': 'Fri, 08 Mar 2013 14:44:05 GMT', 'content-type': 'application/json', 'content-length': '204', 'vary': 'X-Auth-Token'}
RESP BODY: {"endpoint": {"adminurl": null, "region": "north", "internalurl": null, "service_id": "239ff97ce7a14e2b92b7a513d1bb243f", "id": "8e4785365bb84db2a00611d37f1ec522", "publicurl": "http://localhost:5000/"}}

+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminurl | |
| id | 8e4785365bb84db2a00611d37f1ec522 |
| internalurl | |
| publicurl | http://localhost:5000/ |
| region | north |
| service_id | 239ff97ce7a14e2b92b7a513d1bb243f |
+-------------+----------------------------------+

Instead, v3 returns the expected endpoint with null 'internalurl' and 'adminurl' attributes.

GET http://localhost:35357/v3/endpoints
X-Auth-Token: ADMIN

200 OK
Status: 200
Content-Length: 1506
Content-Location: http://localhost:35357/v3/endpoints
Vary: X-Auth-Token
Date: Fri, 08 Mar 2013 14:47:20 GMT
Content-Type: application/json

{
  "endpoints": [

    ...

    {
      "links": {
        "self": "http://localhost:5000/v3/endpoints/663d7b416f894741ae5957af68898a3e"
      },
      "adminurl": null,
      "region": "north",
      "legacy_endpoint_id": "8e4785365bb84db2a00611d37f1ec522",
      "url": "http://localhost:5000/",
      "id": "663d7b416f894741ae5957af68898a3e",
      "interface": "public",
      "service_id": "239ff97ce7a14e2b92b7a513d1bb243f",
      "internalurl": null
    }
  ],
  "links": {
    "self": "http://localhost:5000/v3/endpoints",
    "next": null,
    "previous": null
  }
}

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/24398

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/24398
Committed: http://github.com/openstack/keystone/commit/0a81b69ef696264654c37213f4954f222fc78700
Submitter: Jenkins
Branch: master

commit 0a81b69ef696264654c37213f4954f222fc78700
Author: Dolph Mathews <email address hidden>
Date: Wed Mar 13 21:59:38 2013 -0500

    Discard null endpoints (bug 1152632)

    If a v2 client passed {..., "adminurl": null, ...} in a endpoint-create
    request, then the null value was being persisted on an endpoint with a
    different interface value (i.e. a publicly facing endpoint would have an
    "adminurl": null value inexplicably attached to it.)

    This change simply pops null urls from the endpoint and discards them.

    Change-Id: Idd0964b6ec34fbc8b979253d32f655ea9797f259

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