API JSON fields to support more than string and int values

Bug #1398350 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Lucas Alvares Gomes

Bug Description

Right now fields json fields like "extra", "properties", "driver_info" in our API only supports strings and integers. An attempt to post a float value for example would fail with:

[-] Client-side error: Invalid input for field/attribute value. Value: '0.123'. Wrong type. Expected '<type 'unicode'>', got '<type 'float'>' [1]

We should add support for all json primitives types to be supported on those fields, those are: bytes,
unicode, float, long, int, dict, list and bool.

[1] http://logs.openstack.org/23/137623/1/gate/gate-grenade-dsvm-ironic-sideways/2cda0f7/logs/new/screen-ir-api.txt.gz?level=WARNING#

Changed in ironic:
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
importance: Undecided → Medium
Changed in ironic:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/137762
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=98d4bfd3ec214f941d2f99bc8b5279bd0a9545ee
Submitter: Jenkins
Branch: master

commit 98d4bfd3ec214f941d2f99bc8b5279bd0a9545ee
Author: Lucas Alvares Gomes <email address hidden>
Date: Fri Nov 28 11:06:05 2014 +0000

    Extend API multivalue fields

    This patch is creating a new JsonType type that accepts all the json
    primitive types: bytes, unicode, float, long, int, dict, list, None
    and bool.

    Since the MultiType type is no longer used anywhere in the code it's
    been deleted.

    Closes-Bug: #1398350
    Change-Id: I2d9e4f20419ca2789c2f60034c403d28a5e2b9e8

Changed in ironic:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ironic:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: kilo-2 → 2015.1.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.