Blank Description for projects being handled incorrectly

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

Bug Description

Invoking keystone api to create tenant via json and xml with empty description, the result is different, description is empty of json response, while the xml response is {}

JSON: request
curl -X POST -H "X-Auth-Token: 03ac2380c4a549d1af8bb4542bcdf383" http://10.10.0.1:35357/v2.0/tenants -d '{"tenant":{"name":"test1","description":"","enabled":"true"}}' -H "Content-Type: application/json"
result:

keystone tenant-get 9405381772cf4d56a6e7598fa6f738b5
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | |
| enabled | True |
| id | 9405381772cf4d56a6e7598fa6f738b5 |
| name | test |
+-------------+----------------------------------+

XML: request<?xml version="1.0" encoding="UTF-8"?>
<tenant xmlns="http://docs.openstack.org/identity/api/v2.0" enabled="true" name="demo3">
  <description></description>
</tenant>

result:keystone tenant-get 94ebd5eea09c43eaa2fa61e00dec0a83
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | {} |
| enabled | True |
| id | 94ebd5eea09c43eaa2fa61e00dec0a83 |
| name | demo |
+-------------+----------------------------------+

Revision history for this message
David Geng (genggjh) wrote :

Need make the behavior consistent on keystone response between xml and json formatter

Changed in keystone:
assignee: nobody → David Geng (genggjh)
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/26847

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

Reviewed: https://review.openstack.org/26847
Committed: http://github.com/openstack/keystone/commit/9b9a3d53a901da7ef2b80f62e7e6a668be161bec
Submitter: Jenkins
Branch: master

commit 9b9a3d53a901da7ef2b80f62e7e6a668be161bec
Author: gengjh <email address hidden>
Date: Fri Apr 12 20:44:41 2013 +0800

    Set empty element to ""

    When serializer xml formatter response need set empty element to "" to
    align with JSON formatter.

    Fix bug 1168317

    Change-Id: I4985791095f43eac88fe42ec16f6a78bbf77ec07

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → havana-1
status: Fix Committed → Fix Released
Revision history for this message
hanzhf (hanzhf) wrote :

We also met this problem in grizzly, can this fix be merged into Stable-grizzly ?

David Geng (genggjh)
tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/31835

Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Low
Thierry Carrez (ttx)
Changed in keystone:
milestone: havana-1 → 2013.2
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential
no longer affects: keystone/grizzly
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.