Resolve authorization issue

When a tenant network is attached to a router, where the users has no
permissions to the router, the use should still be able to create an LB
service.

Change-Id: I36cbe2d900579cccbac42592161a65719fbba4a0
This commit is contained in:
Kobi Samoray 2021-06-29 10:38:39 +03:00
parent a0cc949ec6
commit 72fc77b3df
1 changed files with 4 additions and 3 deletions

View File

@ -58,11 +58,12 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
self.flavor_plugin, context, lb.get('flavor_id'), None)
if router_id:
# Make sure the NSX service router exists
e_ctx = context.elevated()
if not self.core_plugin.service_router_has_services(
context, router_id):
self.core_plugin.create_service_router(context, router_id)
e_ctx, router_id):
self.core_plugin.create_service_router(e_ctx, router_id)
lb_service = self._create_lb_service(
context, service_client, lb['tenant_id'],
e_ctx, service_client, lb['tenant_id'],
router_id, nsx_router_id, lb['id'], lb_size)
else:
lb_service = self._create_lb_service_without_router(