Posting a sample with a string value for resource_metadata results in a 500 when it should be a 400

Bug #1428628 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Chris Dent
WSME
Fix Released
Undecided
Mehdi Abaakouk

Bug Description

The following request to the ceilometer api results in an untrapped AttributeError and an eventual 500. It should result in a 400.

    - name: post counter with wrong metadata
      desc: metadata a string causes 500
      xfail: true
      url: /v2/meters/apples
      method: POST
      request_headers:
          content-type: application/json
      data:
          - counter_name: apples
            counter_type: gauge
            counter_unit: instance
            counter_volume: 3
            resource_id: aa9431c1-8d69-4ad3-803a-8d4a6b89fdaa
            timestamp: "2013-01-01 23:23:20"
            resource_metadata: "a string"

Chris Dent (cdent)
description: updated
Mehdi Abaakouk (sileht)
Changed in wsme:
assignee: nobody → Mehdi Abaakouk (sileht)
Mehdi Abaakouk (sileht)
Changed in ceilometer:
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to wsme (master)

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

Changed in wsme:
status: New → In Progress
Changed in ceilometer:
assignee: nobody → Mehdi Abaakouk (sileht)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to wsme (master)

Reviewed: https://review.openstack.org/208464
Committed: https://git.openstack.org/cgit/stackforge/wsme/commit/?id=03f0c0b4d60906ce7a112094ada7df459982a4df
Submitter: Jenkins
Branch: master

commit 03f0c0b4d60906ce7a112094ada7df459982a4df
Author: Mehdi Abaakouk <email address hidden>
Date: Mon Aug 3 14:47:58 2015 +0200

    json: raise ValueError invalid list or dict

    If the expected datatype is ArrayType or DictType
    but the json value is something else raise
    ValueError instead of 500 erro because we can browse the
    dict or the list.

    Closes bug: #1428628

    Change-Id: Ibd4d95815c0b81ded8304bba4ca83e6df32d86ae

Changed in wsme:
status: In Progress → Fix Committed
Changed in wsme:
milestone: none → 0.8.0
status: Fix Committed → Fix Released
Changed in ceilometer:
assignee: Mehdi Abaakouk (sileht) → Chris Dent (chdent)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

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

commit d7428b7c3873bb47683c4f4d547fce138b79a74b
Author: Mehdi Abaakouk <email address hidden>
Date: Mon Aug 3 14:41:42 2015 +0200

    Update tests to reflect WSME 0.8 fixes

    All these bugs are now fixed in wsme 0.8.0

    Closes-bug: #1424642
    Closes-bug: #1423634
    Closes-bug: #1419110
    Closes-bug: #1428185
    Closes-bug: #1428628
    Closes-bug: #1428658
    Closes-bug: #1428624

    Change-Id: Iea8507ebc54f42786a44bfcd96246b88dd998bf0

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-3 → 5.0.0
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.