diff --git a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py index 37a455a429..c5a52570f0 100644 --- a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py +++ b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v.py @@ -1318,10 +1318,12 @@ class NsxVPluginV2(agents_db.AgentDbMixin, for route in routes: for port in ports: for ip in port['fixed_ips']: - subnet = self.get_subnet(context, ip['subnet_id']) + subnet = self.get_subnet(context.elevated(), + ip['subnet_id']) if netaddr.all_matching_cidrs( route['nexthop'], [subnet['cidr']]): - net = self.get_network(context, subnet['network_id']) + net = self.get_network(context.elevated(), + subnet['network_id']) route['network_id'] = net['id'] if net.get(ext_net_extn.EXTERNAL): route['external'] = True diff --git a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v_drivers/shared_router_driver.py b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v_drivers/shared_router_driver.py index b0b1a6bd5c..4fe0a855bf 100644 --- a/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v_drivers/shared_router_driver.py +++ b/vmware_nsx/neutron/plugins/vmware/plugins/nsx_v_drivers/shared_router_driver.py @@ -83,7 +83,7 @@ class RouterSharedDriver(router_driver.RouterBaseDriver): routes = self.plugin._get_extra_routes_by_router_id( context, router_id) filters = {'device_id': [router_id]} - ports = self.plugin.get_ports(context, filters) + ports = self.plugin.get_ports(context.elevated(), filters) self.plugin._add_network_info_for_routes(context, routes, ports) all_routes.extend(routes) if not nexthop: