From 0fee496538a36e7db5b7e2c7e5bbd5cff2aedd53 Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Mon, 6 May 2013 17:33:44 +0200 Subject: [PATCH] Fetch routers ports for metadata access from DB Bug 1176963 There is no need to retrieve the ports from the NVP backend, so a DB query will be enough. Change-Id: If3529cc5694434e8cdc9d21a4043f94212146d2d --- quantum/plugins/nicira/common/metadata_access.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/quantum/plugins/nicira/common/metadata_access.py b/quantum/plugins/nicira/common/metadata_access.py index d1e63b64f..2204344be 100644 --- a/quantum/plugins/nicira/common/metadata_access.py +++ b/quantum/plugins/nicira/common/metadata_access.py @@ -121,9 +121,11 @@ class NvpMetadataAccess(object): device_filter = {'device_id': [router_id], 'device_owner': [l3_db.DEVICE_OWNER_ROUTER_INTF]} with ctx_elevated.session.begin(subtransactions=True): - ports = self.get_ports(ctx_elevated, filters=device_filter) - # Filter out ports without an IP (those are 'stale' router ports) - ports = [port for port in ports if port['fixed_ips']] + # Retrieve ports without going to plugin + ports = [self._make_port_dict(port) + for port in self._get_ports_query( + ctx_elevated, filters=device_filter) + if port['fixed_ips']] try: if ports: if (do_create and -- 2.45.2