filter_kwargs adds extra _id to key

Bug #1742800 reported by Adrian Turjak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
In Progress
Medium
Adrian Turjak

Bug Description

In the filter_kwargs decorator if the id_value does not match the ref, we add '_id' to the key. This means if someone supplies a param as some_function(user_id=UserObject) the id_value will be correct after going through filter_kwargs but the key will be "user_id_id" which will be ignored by the server.

The issue is that this doesn't throw an error, and a user may assume the API call is actually using/filtering by the user_id value supplied, when in truth it isn't.

Simple fix, check if the key already ends with "_id", and then only if not append the postfix.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

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

Changed in python-keystoneclient:
assignee: nobody → Adrian Turjak (adriant-y)
status: New → In Progress
Changed in python-keystoneclient:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-keystoneclient (master)

Change abandoned by Adrian Turjak (<email address hidden>) on branch: master
Review: https://review.opendev.org/532990

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.