From b2fc9700ee4223f648b0a4fb8dc604b245a80f45 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Tue, 18 Jul 2017 15:26:39 -0700 Subject: [PATCH] pseudo agent port binding: log owner and device_id When port binding fails, log device_owner and device_id in addition to the existing ones. They are helpful to determine what port is for. e.g. vm, dhcp, router etc when diagnosing failure of port binding. There is a race condition between dhcp port creation and network deletion because notification to dhcp agent can be delayed. If dhcp port is to be bound after network is deleted, the binding fails. It's safe to ignore such a case. Change-Id: I26e235fa3e0bdab5e3d568a9a0f60a380642c760 --- networking_odl/ml2/pseudo_agentdb_binding.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/networking_odl/ml2/pseudo_agentdb_binding.py b/networking_odl/ml2/pseudo_agentdb_binding.py index 076beeba6..1e191fa17 100644 --- a/networking_odl/ml2/pseudo_agentdb_binding.py +++ b/networking_odl/ml2/pseudo_agentdb_binding.py @@ -254,9 +254,12 @@ class PseudoAgentDBBindingController(port_binding.PortBindingController): break # Port binding suceeded! else: # Port binding failed! LOG.warning( - "Failed to bind Port %(pid)s for host %(host)s on network " - "%(network)s.", { + "Failed to bind Port %(pid)s devid %(device_id)s " + "owner %(owner)s for host %(host)s " + "on network %(network)s.", { 'pid': port_context.current['id'], + 'devce_id': port_context.current['device_id'], + 'owner': port_context.current['device_owner'], 'host': port_context.host, 'network': port_context.network.current['id']}) else: # No hostconfig found for host in agentdb.