Skip to content

Commit 5c8062f

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix certs ops as trustee for existing clusters"
2 parents 8c78862 + 813e206 commit 5c8062f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

magnum/db/sqlalchemy/api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,16 @@ def _add_tenant_filters(self, context, query):
131131
kst = osc.keystone()
132132

133133
# User in a regular project (not in the trustee domain)
134-
if context.project_id and context.domain_id != kst.trustee_domain_id:
134+
if (
135+
context.project_id
136+
and context.user_domain_id != kst.trustee_domain_id
137+
):
135138
query = query.filter_by(project_id=context.project_id)
136139
# Match project ID component in trustee user's user name against
137140
# cluster's project_id to associate per-cluster trustee users who have
138141
# no project information with the project their clusters/cluster models
139142
# reside in. This is equivalent to the project filtering above.
140-
elif context.domain_id == kst.trustee_domain_id:
143+
elif context.user_domain_id == kst.trustee_domain_id:
141144
user_name = kst.client.users.get(context.user_id).name
142145
user_project = user_name.split('_', 2)[1]
143146
query = query.filter_by(project_id=user_project)

0 commit comments

Comments
 (0)