Merge "Suppresses a warning when no agents are configured"

This commit is contained in:
Jenkins 2016-08-09 16:06:55 +00:00 committed by Gerrit Code Review
commit 3ecbd74fb8
1 changed files with 3 additions and 0 deletions

View File

@ -390,6 +390,9 @@ class DhcpAgentSchedulerDbMixin(dhcpagentscheduler
self._filter_bindings(context, down_bindings)]
agents = self.get_agents_db(
context, {'agent_type': [constants.AGENT_TYPE_DHCP]})
if not agents:
# No agents configured so nothing to do.
return
active_agents = [agent for agent in agents if
self.is_eligible_agent(context, True, agent)]
if not active_agents: