]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix minor nits in _notify_l3_agent_new_port()
authorSaggi Mizrahi <saggi.mizrahi@huawei.com>
Wed, 18 Mar 2015 13:57:41 +0000 (15:57 +0200)
committerSaggi Mizrahi <saggi.mizrahi@huawei.com>
Mon, 23 Mar 2015 13:42:46 +0000 (15:42 +0200)
- Moved string formatting to the log instead of call
- Used dict.get() instead of __getitem__(). I assume that was the
  author's intent or the subsequent condition in redundant.

Change-Id: If2fa3654591607c01effc12cc1bafea38ac4945d
Signed-off-by: Saggi Mizrahi <saggi.mizrahi@huawei.com>
neutron/db/l3_dvrscheduler_db.py

index a82bc81e4c0395dbc85f7f0458b1a3e3e5fcdbe2..95f31afcefb4cae61035f009dc8b68514b8ff5c8 100644 (file)
@@ -317,8 +317,10 @@ class L3_DVRsch_db_mixin(l3agent_sch_db.L3AgentSchedulerDbMixin):
 
 
 def _notify_l3_agent_new_port(resource, event, trigger, **kwargs):
-    LOG.debug('Received %s %s' % (resource, event))
-    port = kwargs['port']
+    LOG.debug('Received %(resource)s %(event)s', {
+        'resource': resource,
+        'event': event})
+    port = kwargs.get('port')
     if not port:
         return