Make os_user_role respect domain when querying for projects (#2520)
This commit is contained in:
parent
bc8e8173ad
commit
0a9cdf647a
1 changed files with 9 additions and 5 deletions
|
@ -165,16 +165,20 @@ def main():
|
|||
if g is None:
|
||||
module.fail_json(msg="Group %s is not valid" % group)
|
||||
filters['group'] = g['id']
|
||||
if project:
|
||||
p = cloud.get_project(project)
|
||||
if p is None:
|
||||
module.fail_json(msg="Project %s is not valid" % project)
|
||||
filters['project'] = p['id']
|
||||
if domain:
|
||||
d = cloud.get_domain(domain)
|
||||
if d is None:
|
||||
module.fail_json(msg="Domain %s is not valid" % domain)
|
||||
filters['domain'] = d['id']
|
||||
if project:
|
||||
if domain:
|
||||
p = cloud.get_project(project, domain_id=filters['domain'])
|
||||
else:
|
||||
p = cloud.get_project(project)
|
||||
|
||||
if p is None:
|
||||
module.fail_json(msg="Project %s is not valid" % project)
|
||||
filters['project'] = p['id']
|
||||
|
||||
assignment = cloud.list_role_assignments(filters=filters)
|
||||
|
||||
|
|
Loading…
Reference in a new issue