Make port binding message on dead agents clear

The previous message was misleading because it made it
sound like port binding was being attempted even though
the agent is dead. However, the actual logic is that
binding will be completely skipped if the agent is dead.

This patch updates the message to make that clear and also
provides the port ID as part of the warning so operators
without debugging enabled can see which ports failed.

Change-Id: Ic5031ad8fb06062e9d12b87430d89fc37eb6cde0
Closes-Bug: #1522192
This commit is contained in:
Kevin Benton 2015-12-02 15:35:00 -08:00
parent f308869372
commit 7dc718d1d7
1 changed files with 3 additions and 2 deletions

View File

@ -73,8 +73,9 @@ class AgentMechanismDriverBase(api.MechanismDriver):
LOG.debug("Bound using segment: %s", segment)
return
else:
LOG.warning(_LW("Attempting to bind with dead agent: %s"),
agent)
LOG.warning(_LW("Refusing to bind port %(pid)s to dead agent: "
"%(agent)s"),
{'pid': context.current['id'], 'agent': agent})
@abc.abstractmethod
def try_to_bind_segment_for_agent(self, context, segment, agent):