Fix os_user_role issue to grant a role in a domain

Fixes #66525.

Backport of https://github.com/openstack/ansible-collections-openstack/commit/4c03ae.
pull/68620/merge
yatinkarel 6 years ago committed by Matt Clay
parent 203e74b73a
commit a0491f804f

@ -0,0 +1,2 @@
bugfixes:
- os_user_role - Fix os_user_role issue to grant a role in a domain.

@ -130,6 +130,7 @@ def main():
sdk, cloud = openstack_cloud_from_module(module)
try:
filters = {}
domain_id = None
r = cloud.get_role(role)
if r is None:
@ -141,6 +142,7 @@ def main():
if d is None:
module.fail_json(msg="Domain %s is not valid" % domain)
filters['domain'] = d['id']
domain_id = d['id']
if user:
if domain:
u = cloud.get_user(user, domain_id=filters['domain'])
@ -155,7 +157,6 @@ def main():
if g is None:
module.fail_json(msg="Group %s is not valid" % group)
filters['group'] = g['id']
domain_id = None
if project:
if domain:
p = cloud.get_project(project, domain_id=filters['domain'])

Loading…
Cancel
Save