Inconsistency in filtering resources by boolean options

Bug #2045803 reported by Lukas Piwowarski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
In Progress
Medium
Gregory Thiemonge

Bug Description

There seems to be an inconsistency in filtering resources [1] using boolean options.

For example, when I try to filter out members of a pool using admin_state_up boolean value then values like 'true' and 'false' work as expected.

However, when I want to filter out all members using the backup (or other boolean fields like 'enabled') field then 'true'/'false' values do not work as expected. The user must use the values stored in the database 1/0 instead.

curl -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -H 'X-Auth-Token: XXXXX' \
     http://xxxxx/load-balancer/v2.0/lbaas/pools/XXXX/members?backup=true

I get non-backup members from the pool in the response. See the attached file for more examples. In the file, I work with 1 backup member and 2 default members.

[1] https://docs.openstack.org/api-ref/load-balancer/v2/#filtering-and-column-selection

Revision history for this message
Lukas Piwowarski (lukas-piwowarski) wrote :
description: updated
Revision history for this message
Gregory Thiemonge (gthiemonge) wrote :

Thanks for reporting it Lukas,
I confirm this bug, the Octavia API doesn't handle correctly the boolean filters.
There's only a specific case for "enabled": https://opendev.org/openstack/octavia/src/commit/261ee7dcffb1fe634152c4f2ccf79264c1a653b5/octavia/db/base_models.py#L118-L120

we need to apply the same conversion to the other booleans (perhaps not in this function but in the data_models classes)

Changed in octavia:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to octavia (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/octavia/+/903081

Changed in octavia:
status: Confirmed → In Progress
Changed in octavia:
assignee: nobody → Gregory Thiemonge (gthiemonge)
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.