Skip to content

Commit da292ca

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "[OVN] Use elevated context to retrieve subnet in router port configuration" into stable/2023.1
2 parents fd0eabc + 68542c0 commit da292ca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,13 @@ def _get_nets_and_ipv6_ra_confs_for_router_port(self, context, port):
12031203

12041204
for fixed_ip in port_fixed_ips:
12051205
subnet_id = fixed_ip['subnet_id']
1206-
subnet = self._plugin.get_subnet(context, subnet_id)
1206+
# NOTE(ralonsoh): it is needed to use the "admin" context here to
1207+
# retrieve the subnet. The subnet object is not handling correctly
1208+
# the RBAC filtering because is not filtering by
1209+
# "access_as_external", as network object is doing in
1210+
# ``_network_filter_hook``. See LP#2051831.
1211+
# TODO(ralonsoh): once LP#2051831 is fixed, remove "elevated()".
1212+
subnet = self._plugin.get_subnet(context.elevated(), subnet_id)
12071213
cidr = netaddr.IPNetwork(subnet['cidr'])
12081214
networks.add("%s/%s" % (fixed_ip['ip_address'],
12091215
str(cidr.prefixlen)))

0 commit comments

Comments
 (0)