update user is a 'PUT' not a 'POST'

Bug #1273857 reported by Chris Fields
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
Medium
ZhiQiang Fan

Bug Description

Using 'PUT' updates users; 'POST' yieds 'resource not found'
-----------------------------------
Built: 2014-01-27T23:48:59 00:00
git SHA: 26f15593ba2bbd0dd52c6c539824bc8f52ad030c
URL: http://docs.openstack.org/api/openstack-identity-service/2.0/content/User_Operations_OS-KSADM.html
source File: file:/home/jenkins/workspace/identity-api-v2.0/openstack-identity-api/v2.0/src/docbkx/OS-KSADM/OS-KSADM-admin-devguide.xml
xml:id: User_Operations_OS-KSADM

Revision history for this message
Chris Fields (chris-fields) wrote :

The documentation says 'POST' to update users. Needs to say 'PUT'

ZhiQiang Fan (aji-zqfan)
Changed in openstack-manuals:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

# keystone --debug user-update test --email <email address hidden>
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
REQ: curl -i -X GET http://160.132.0.17:35357/v2.0/users -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: ac60d12b5b6c668f726a"
RESP: [200] CaseInsensitiveDict({'date': 'Wed, 29 Jan 2014 03:12:46 GMT', 'vary': 'X-Auth-Token', 'content-length': '1587', 'content-type': 'application/json'})
RESP BODY: {"users": [{"name": "haobinbin", "id": "1b47ba358f884013b3f69a01dc6b38cc", "enabled": true, "email": "<email address hidden>", "tenantId": "f61bfd04533a4a208349dc3351aec4ec"}, {"name": "hbb_admin", "id": "1ecc9cfbe37e42b7927ede278896ff54", "enabled": true, "email": "<email address hidden>", "tenantId": "f61bfd04533a4a208349dc3351aec4ec"}, {"name": "cinder", "enabled": true, "email": null, "id": "3f3788d29d134b4ba0845838cc328d08"}, {"name": "user-foo", "enabled": true, "email": null, "id": "4232be9cc2d54f0882f5911d84550192"}, {"name": "admin", "enabled": true, "email": null, "id": "823b5f325eab4cf1912733831fba2556"}, {"name": "nova", "enabled": true, "email": null, "id": "8467beb597b148cc8b6a9670df6d20c2"}, {"name": "foo-user", "enabled": true, "email": null, "id": "8af4191734734d959939e536c495954d"}, {"name": "glance", "enabled": true, "email": null, "id": "8da0c99dd5764d9fa3d67c778169d758"}, {"name": "user-bar", "enabled": true, "email": null, "id": "8f4f975fa8474c92bc9a44c56bdc8c7a"}, {"name": "hbb", "id": "ab3fa6d906a14501a0f15e139fd33554", "enabled": true, "email": "<email address hidden>", "tenantId": "abdb5d4280b64917bfdeaab3368c03fb"}, {"name": "test", "id": "b1290a3ad3f2423ab842c58c3f361f4e", "enabled": true, "email": "<email address hidden>", "tenantId": "f61bfd04533a4a208349dc3351aec4ec"}, {"name": "ceilometer", "enabled": true, "email": null, "id": "b9b6a55ee4f2412695a8dacb9229c16b"}, {"name": "heat", "enabled": true, "email": null, "id": "ea71b42c1e884258aeae640297c56b02"}, {"name": "neutron", "enabled": true, "email": null, "id": "ec271eb23ac2472db024b8d1d282b76e"}]}

REQ: curl -i -X PUT http://160.132.0.17:35357/v2.0/users/b1290a3ad3f2423ab842c58c3f361f4e -H "User-Agent: python-keystoneclient" -H "Content-Type: application/json" -H "X-Auth-Token: ac60d12b5b6c668f726a"
REQ BODY: {"user": {"email": "<email address hidden>", "id": "b1290a3ad3f2423ab842c58c3f361f4e"}}

RESP: [200] CaseInsensitiveDict({'date': 'Wed, 29 Jan 2014 03:12:47 GMT', 'vary': 'X-Auth-Token', 'content-length': '202', 'content-type': 'application/json'})
RESP BODY: {"user": {"name": "test", "extra": {"email": "<email address hidden>"}, "enabled": true, "id": "b1290a3ad3f2423ab842c58c3f361f4e", "tenantId": "f61bfd04533a4a208349dc3351aec4ec", "email": "<email address hidden>"}}

User has been updated.

Changed in openstack-api-site:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

It is strange that the tenant-update use post instead of put

# keystone --debug tenant-update admin --description 'admin tenant'
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
REQ: curl -i -X GET http://160.132.0.17:35357/v2.0/tenants -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: ac60d12b5b6c668f726a"
RESP: [200] CaseInsensitiveDict({'date': 'Wed, 29 Jan 2014 03:44:48 GMT', 'vary': 'X-Auth-Token', 'content-length': '256', 'content-type': 'application/json'})
RESP BODY: {"tenants_links": [], "tenants": [{"description": "Service Tenant", "enabled": true, "id": "abdb5d4280b64917bfdeaab3368c03fb", "name": "service"}, {"description": "Admin Tenant", "enabled": true, "id": "f61bfd04533a4a208349dc3351aec4ec", "name": "admin"}]}

REQ: curl -i -X POST http://160.132.0.17:35357/v2.0/tenants/f61bfd04533a4a208349dc3351aec4ec -H "User-Agent: python-keystoneclient" -H "Content-Type: application/json" -H "X-Auth-Token: ac60d12b5b6c668f726a"
REQ BODY: {"tenant": {"description": "admin tenant", "enabled": true, "id": "f61bfd04533a4a208349dc3351aec4ec", "name": "admin"}}

RESP: [200] CaseInsensitiveDict({'date': 'Wed, 29 Jan 2014 03:44:48 GMT', 'vary': 'X-Auth-Token', 'content-length': '156', 'content-type': 'application/json'})
RESP BODY: {"tenant": {"description": "admin tenant", "extra": {}, "enabled": true, "id": "f61bfd04533a4a208349dc3351aec4ec", "domain_id": "default", "name": "admin"}}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to api-site (master)

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

Changed in openstack-api-site:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to identity-api (master)

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

Tom Fifield (fifieldt)
no longer affects: openstack-manuals
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/69788
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=7fd1c01aa77d73032f2e10b923c5b09344c83942
Submitter: Jenkins
Branch: master

commit 7fd1c01aa77d73032f2e10b923c5b09344c83942
Author: ZhiQiang Fan <email address hidden>
Date: Wed Jan 29 12:35:23 2014 +0800

    Use PUT method for user update

    Kestone API V2 uses PUT method for user update, but this document uses
    wrong method POST.

    Change-Id: Ib6e03adc8372200d8e8b8a26a7beb06bbf68c9be
    Closes-Bug: #1273857

Changed in openstack-api-site:
status: In Progress → Fix Released
Anne Gentle (annegentle)
Changed in openstack-api-site:
status: Fix Released → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to identity-api (master)

Reviewed: https://review.openstack.org/69789
Committed: https://git.openstack.org/cgit/openstack/identity-api/commit/?id=260c6d974576675c3266ed2dabf6111e614d81d2
Submitter: Jenkins
Branch: master

commit 260c6d974576675c3266ed2dabf6111e614d81d2
Author: ZhiQiang Fan <email address hidden>
Date: Wed Jan 29 12:39:20 2014 +0800

    Use PUT method for user update

    Kestone API V2 uses PUT method for user update, but this document uses
    wrong method POST.

    Change-Id: I7e6793a4b0795b992ca1e2615903ceb8a4d3a41e
    Closes-Bug: #1273857

Changed in openstack-api-site:
status: In Progress → Fix Committed
Changed in openstack-api-site:
importance: Undecided → Medium
status: Fix Committed → Fix Released
milestone: none → icehouse
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.