mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-08 22:34:12 +00:00
Reverted identity_user_info from identity.users() to search_users()
Commit2df07f3523changed module identity_user_info to use function identity.users() instead of search_users(). The first does not allow to search for id with parameter name while the previous and current search_users() function has a name_or_id parameter which allows to search by name and id. Ref.:2df07f3523Change-Id: I71226e578a234d24e068a256cf4a5533ccd4c201
This commit is contained in:
@@ -150,16 +150,15 @@ class IdentityUserInfoModule(OpenStackModule):
|
|||||||
domain = self.params['domain']
|
domain = self.params['domain']
|
||||||
filters = self.params['filters']
|
filters = self.params['filters']
|
||||||
|
|
||||||
|
args = {}
|
||||||
if domain:
|
if domain:
|
||||||
dom_obj = self.conn.identity.find_domain(domain)
|
dom_obj = self.conn.identity.find_domain(domain)
|
||||||
if dom_obj is None:
|
if dom_obj is None:
|
||||||
self.fail_json(
|
self.fail_json(
|
||||||
msg="Domain name or ID '{0}' does not exist".format(domain))
|
msg="Domain name or ID '{0}' does not exist".format(domain))
|
||||||
filters['domain_id'] = dom_obj.id
|
args['domain_id'] = dom_obj.id
|
||||||
|
|
||||||
users = self.conn.identity.users(
|
users = [user.to_dict(computed=False) for user in self.conn.search_users(name, filters, **args)]
|
||||||
name=name, **filters)
|
|
||||||
users = [user.to_dict(computed=False) for user in users]
|
|
||||||
self.exit_json(changed=False, users=users)
|
self.exit_json(changed=False, users=users)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user