Merge "Treat networks shared by RBAC in same way as shared with all tenants" into stable/queens

This commit is contained in:
Zuul 2019-07-03 02:06:53 +00:00 committed by Gerrit Code Review
commit 532c2f7939
1 changed files with 4 additions and 2 deletions

View File

@ -350,9 +350,11 @@ class FieldCheck(policy.Check):
"%(target_dict)s", "%(target_dict)s",
{'field': self.field, 'target_dict': target_dict}) {'field': self.field, 'target_dict': target_dict})
return return
project_id = target_dict.get('project_id')
ctx = (context.Context(tenant_id=project_id) if project_id
else context.get_admin_context())
plugin = directory.get_plugin() plugin = directory.get_plugin()
network = plugin.get_network( network = plugin.get_network(ctx, target_network_id)
context.get_admin_context(), target_network_id)
target_value = network.get(self.field) target_value = network.get(self.field)
if target_value is None: if target_value is None:
LOG.debug("Unable to find requested field: %(field)s in target: " LOG.debug("Unable to find requested field: %(field)s in target: "