resource attributes not normalized on update

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

Bug Description

If you create a consumer with some weird field like "some:wierd-field", the name of the field gets normalized to "some_wierd_field". But when you try to update that field with "some:wierd-field", the name doesn't get normalized, so it creates a new field with the wierd name rather than updating the originally normalized field.

The field name should be normalized on update just like it is on create.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to keystone (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/71416

Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)
status: New → In Progress
Revision history for this message
Dolph Mathews (dolph) wrote : Re: update oauth consumer fields not normalized

Is this actually specific to OAuth?

Changed in keystone:
importance: Undecided → Medium
Revision history for this message
Brant Knudson (blk-u) wrote :

Dolph - just taking a look at identity.controllers, looks like it's not specific to oauth... the oauth code was obviously wrong because Eclipse editor showed an unused variable... looks like in identity.controllers it's only normalizing the dicts for users and groups on create and not on update.

Revision history for this message
Brant Knudson (blk-u) wrote :

Maybe keystone shouldn't be normalizing dicts at all.

Dolph Mathews (dolph)
summary: - update oauth consumer fields not normalized
+ resource attributes not normalized on update
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to keystone (master)

Reviewed: https://review.openstack.org/71416
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=1ddb30c351eded2132780bc42ed9511c5d2a940e
Submitter: Jenkins
Branch: master

commit 1ddb30c351eded2132780bc42ed9511c5d2a940e
Author: Brant Knudson <email address hidden>
Date: Wed Feb 5 17:20:21 2014 -0600

    Add tests for oauth consumer normalize fields

    There were no tests that verified that fields in oauth consumers
    were normalized as expected. The tests show that the fields aren't
    being normalized as expected on update.

    Change-Id: I3bc95766b61d8dc8c85b32f628b275721255e95d
    Related-Bug: #1276857

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/64955
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=1d201973b5a263da544d06a40d880a26f37c3ad6
Submitter: Jenkins
Branch: master

commit 1d201973b5a263da544d06a40d880a26f37c3ad6
Author: Brant Knudson <email address hidden>
Date: Thu Feb 6 09:09:55 2014 -0600

    Correctly normalize consumer fields on update

    The self._normalize_dict() function in ConsumerCrudV3 creates a
    copy of the consumer passed in and doesn't modify it, so this
    line of code didn't do anything. The code is changed to use the
    result as the new consumer rather than discarding it.

    Closes-Bug: #1276857
    Change-Id: Iec7573001ad73f0dc9192a4e74b1c35adc2cda4c

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