deserializing xml results in bad links

Bug #1156594 reported by Dolph Mathews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Dolph Mathews

Bug Description

Deserializing the following XML, which represents a single resource:

            <?xml version="1.0" encoding="UTF-8"?>
            <object xmlns="http://docs.openstack.org/identity/api/v2.0"
                attribute="value">
                    <links>
                        <link rel="self"
                            href="http://localhost:5000/v3/objects/abc123def"/>
                        <link rel="anotherobj"
                            href="http://localhost:5000/v3/anotherobjs/123"/>
                    </links>
            </object>

Results in JSON with collection-style links attached at the root level (including irrelevant "next" and "previous" links):

{
  'object': {
    'attribute': 'value'
  },
  'links': {
    'self': 'http://localhost:5000/v3/objects/abc123def',
    'next': None,
    'anotherobj': 'http://localhost:5000/v3/anotherobjs/123',
    'previous': None
  }
}

Instead of the links appearing on the object itself:

{
  'object': {
    'attribute': 'value',
    'links': {
      'self': 'http://localhost:5000/v3/objects/abc123def',
      'anotherobj': 'http://localhost:5000/v3/anotherobjs/123'
    }
  }
}

Changed in keystone:
status: New → In Progress
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/24636

Dolph Mathews (dolph)
Changed in keystone:
milestone: none → grizzly-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/24636
Committed: http://github.com/openstack/keystone/commit/167a8b7a3ed8f60018826a2d73d4af3b2ae7b66f
Submitter: Jenkins
Branch: master

commit 167a8b7a3ed8f60018826a2d73d4af3b2ae7b66f
Author: Dolph Mathews <email address hidden>
Date: Mon Mar 18 08:21:34 2013 -0500

    Fix XML handling of member links (bug 1156594)

    This is a was revealed as a blocker for the default_project_id scoping
    tests.

    Also improves test coverage of XML de/serialization invertibility. The
    tests were previously sensitive to things like attribute ordering which
    are not relevant to test results. The fix is to compare canonically
    serialized XML instead of whatever lxml spews out.

    Change-Id: I003583038421d35aadbc781144d4cafb09392db5

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: grizzly-rc1 → 2013.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.