search_images filter not working for all fields since >=0.99.0

Bug #2043851 reported by Maximilian Stinsky
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openstacksdk
New
Undecided
Unassigned

Bug Description

Greetings.

I was debugging a problem with the sdk when using search_images with filters where I am not able to filter for all existing fields.

What I found is that the problem was introduced with openstacksdk 0.99.0.

For example with >= 0.99.0 it is not possible to filter for attributed like protected, os_hidden, os_hash_algo and some more. Most importantly for us we are not able to filter on the properties dict anymore.

As an example we have images with the following property attached:
properties={'owner_specified.openstack.md5': '', 'owner_specified.openstack.sha256': '', 'owner_specified.openstack.object': 'images/Ubuntu 22.04 Jammy Jellyfish - Testing', 'description': '2022-08-09', 'source_hash': '465254c8a247de43f477b8b8928ee98b84e3d20df513d5e341bb2cd584d03580', 'uploaded_by': 'Image Uploader', 'stores': 'swift'}

With openstacksdk 0.62.0 it is possible to filter all images by the uploaded_by field like:
images = conn.search_images(filters={ "properties": { "uploaded_by": "Image Uploader" } })

Using version >= 0.99.0 the same filter results in an AttributeError which is triggered by [1]. The same AttributeError is triggered for the other mentioned fields.

The only thing that I found so far which might have caused this is the following change [2].

Maybe someone with more know-how about the openstacksdk could have a look what is broken here.
Thanks in advance!

[1] https://github.com/openstack/openstacksdk/blob/1.5.0/openstack/cloud/_utils.py#L126
[2] https://github.com/openstack/openstacksdk/commit/6c905301def9e3842ac07d38effdb0f71dce99f2

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.