]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove the warning for Scheduling Network
authorchen-li <chen.li@intel.com>
Tue, 12 Nov 2013 01:17:17 +0000 (09:17 +0800)
committerchen-li <chen.li@intel.com>
Tue, 12 Nov 2013 07:56:30 +0000 (15:56 +0800)
when a new port is created, the schedule_network in agentschedulers_db is called.
Since this network may already be hosted, it will directly return None in dhcp_agent_scheduler,
which cause the agentschedulers_db.schedule_network log a warning message.

This is really annoying and making users confused.
And, real warnings are already addressed in the real scheduler function.
which is neutron.scheduler.dhcp_agent_scheduler.ChanceScheduler.schedule by default.

Change-Id: I11bdbe47c2cc0fc45fb143970fb6762678bc27e5
Closes-Bug: #1192786

neutron/db/agentschedulers_db.py

index d50e714e04d04a241b4b3929effaf5f3192731e8..4965d1338737be439c44bf25f71ff2ddfb86e9ae 100644 (file)
@@ -203,11 +203,8 @@ class DhcpAgentSchedulerDbMixin(dhcpagentscheduler
 
     def schedule_network(self, context, created_network):
         if self.network_scheduler:
-            chosen_agent = self.network_scheduler.schedule(
+            return self.network_scheduler.schedule(
                 self, context, created_network)
-            if not chosen_agent:
-                LOG.warn(_('Fail scheduling network %s'), created_network)
-            return chosen_agent
 
     def auto_schedule_networks(self, context, host):
         if self.network_scheduler: