conflict alarm name when alarm-create fail with 400 instead of 409

Bug #1271525 reported by ZhiQiang Fan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
ZhiQiang Fan

Bug Description

# ceilometer alarm-create --meter instance --threshold 10 --name quota-alarm
# ceilometer --debug alarm-create --meter instance --threshold 10 --name quota-alarm
HTTP/1.0 400 Bad Request
date: Wed, 22 Jan 2014 12:16:46 GMT
content-length: 107
content-type: application/json
server: WSGIServer/0.1 Python/2.7.3

{"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring": "Alarm with that name exists"}}

WARNING (http:168) Request returned failure status.
HTTPBadRequest (HTTP 400)

see:
https://github.com/openstack/ceilometer/blob/master/ceilometer/api/controllers/v2.py#L1592
https://github.com/openstack/ceilometer/blob/master/ceilometer/api/controllers/v2.py#L72

there also is a 404 but return 500 for alarm not found:
https://github.com/openstack/ceilometer/blob/master/ceilometer/api/controllers/v2.py#L1294

ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/68775
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=534608a53a7485e35ca7a2819cbaeb10894f05b4
Submitter: Jenkins
Branch: master

commit 534608a53a7485e35ca7a2819cbaeb10894f05b4
Author: ZhiQiang Fan <email address hidden>
Date: Thu Jan 23 17:36:38 2014 +0800

    Use explicit http error code for api v2

    * not exist should be 404
    * conflict should be 409
    * not authorized should be 401

    Change-Id: Ied88290c42e5679761e6d50073c7965c5644f84e
    Closes-Bug: #1271525

Changed in ceilometer:
status: In Progress → Fix Committed
gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → Low
milestone: none → icehouse-3
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-3 → 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.