Suppresses a warning when no agents are configured

Change-Id: Ia8dbf83ce1cdd66d1e0a3e42e8ce216377a61adf
Closes-Bug: #1492773
This commit is contained in:
john_a_joyce 2016-08-01 18:12:57 -04:00
parent ee42af1011
commit 4cb60587a4
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: