]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Use admin context to retrieve metadata ports in NVP plugin
authorarmando-migliaccio <amigliaccio@nicira.com>
Thu, 5 Sep 2013 01:04:55 +0000 (18:04 -0700)
committerarmando-migliaccio <amigliaccio@nicira.com>
Thu, 5 Sep 2013 01:07:26 +0000 (18:07 -0700)
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

neutron/plugins/nicira/dhcp_meta/rpc.py

index b8d09baf48578a500b6455917b68cb703eea854d..02607716dd93574457db33a72632ed160ed0ade1 100644 (file)
@@ -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