From: armando-migliaccio Date: Thu, 5 Sep 2013 01:04:55 +0000 (-0700) Subject: Use admin context to retrieve metadata ports in NVP plugin X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d834935648655f56a813dfa44a57bf5801fdba51;p=openstack-build%2Fneutron-build.git Use admin context to retrieve metadata ports in NVP plugin The port that connects the router and the metadata network is created with admin context, so use the elevated one. Change-Id: Idd416fe0841f6aea80da3a3b66a80a451e0360fd Closes-Bug: 1220877 --- diff --git a/neutron/plugins/nicira/dhcp_meta/rpc.py b/neutron/plugins/nicira/dhcp_meta/rpc.py index b8d09baf4..02607716d 100644 --- a/neutron/plugins/nicira/dhcp_meta/rpc.py +++ b/neutron/plugins/nicira/dhcp_meta/rpc.py @@ -124,14 +124,12 @@ def handle_router_metadata_access(plugin, context, router_id, do_create=True): LOG.warn(_("Overlapping IPs must be enabled in order to setup " "the metadata access network")) return - # As we'll use a different device_owner for metadata interface - # this query will return only 'real' router interfaces ctx_elevated = context.elevated() device_filter = {'device_id': [router_id], 'device_owner': [l3_db.DEVICE_OWNER_ROUTER_INTF]} # Retrieve ports calling database plugin ports = db_base_plugin_v2.NeutronDbPluginV2.get_ports( - plugin, context, filters=device_filter) + plugin, ctx_elevated, filters=device_filter) try: if ports: if (do_create and