ovirt: Return ID for permissions facts (#39721)
This commit is contained in:
parent
9eff1f1d74
commit
dda31aa3f7
1 changed files with 7 additions and 1 deletions
|
@ -94,7 +94,12 @@ from ansible.module_utils.ovirt import (
|
|||
def _permissions_service(connection, module):
|
||||
if module.params['user_name']:
|
||||
service = connection.system_service().users_service()
|
||||
entity = search_by_name(service, module.params['user_name'])
|
||||
entity = next(iter(service.list(search='usrname={}'.format(
|
||||
'{}@{}'.format(module.params['user_name'], module.params['authz_name'])
|
||||
)
|
||||
)),
|
||||
None
|
||||
)
|
||||
else:
|
||||
service = connection.system_service().groups_service()
|
||||
entity = search_by_name(service, module.params['group_name'])
|
||||
|
@ -125,6 +130,7 @@ def main():
|
|||
for key, value in p.__dict__.items():
|
||||
if value and isinstance(value, sdk.Struct):
|
||||
newperm[key[1:]] = get_link_name(connection, value)
|
||||
newperm['%s_id' % key[1:]] = value.id
|
||||
permissions.append(newperm)
|
||||
|
||||
module.exit_json(
|
||||
|
|
Loading…
Reference in a new issue