Browse Source

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

changes/12/663712/2
Zuul 2 months ago
parent
commit
532c2f7939
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      neutron/policy.py

+ 4
- 2
neutron/policy.py View File

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

Loading…
Cancel
Save