Consider using service proxies for info modules

Bug #2051704 reported by Simon Hensel
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ansible-collections-openstack
New
Undecided
Unassigned

Bug Description

Currently, the Openstack.Cloud collection uses the connection.search_* functions to retreive data in the *_info modules.

These functions are not only currently bugged and don't apply filters correctly (see https://bugs.launchpad.net/openstacksdk/+bug/2051698), but are also marked as deprecated:
https://github.com/openstack/openstacksdk/blob/f9ce151f903f5cba2ce13f9531640fec3b0e5bfd/openstack/cloud/_network.py#L51

For example, when retrieving projects, replace conn.search_projects() with conn.identity.projects(**query):
https://github.com/openstack/ansible-collections-openstack/blob/e009f80ffce5975d69018b8badd46297c7a90ec6/plugins/modules/project_info.py#L122

These service proxies are already used when changing or creating projects (or any type of resource for that matter):
https://github.com/openstack/ansible-collections-openstack/blob/e009f80ffce5975d69018b8badd46297c7a90ec6/plugins/modules/project.py#L214

These search_* cloud layer functions use the proxy layer under the hood anyways, so why not make all API calls uniform and avoid deprecated functions?
The contributor guide also lists proxy methods as preferred over the cloud layer.
The cloud collection version 2.X also requires the latest version of the openstacksdk (>=1.0), so it makes sense IMO to update to the more modern proxy interface.

This is to incite some discussion, I am happy to provide patches should this change be desired.

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.