]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
l2pop: get_agent_ports: Don't yield (None, {})
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Sun, 10 Aug 2014 23:39:59 +0000 (08:39 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 13 Aug 2014 23:35:31 +0000 (08:35 +0900)
There's no point to yield None lvm with empty entries.

Closes-Bug: #1355759
Related: blueprint ofagent-l2pop
Change-Id: I42aeb48a062d35038116978d70c8dac4139a5583

neutron/agent/l2population_rpc.py
neutron/tests/unit/agent/test_l2population_rpc.py

index b3dbc015e2fd7486d289991d9ebe932598f7856d..93f6395dd9f62111cfeeb8f627eb38be8f0d5d88 100644 (file)
@@ -166,7 +166,9 @@ class L2populationRpcCallBackTunnelMixin(L2populationRpcCallBackMixin):
     def get_agent_ports(self, fdb_entries, local_vlan_map):
         for network_id, values in fdb_entries.items():
             lvm = local_vlan_map.get(network_id)
-            agent_ports = values.get('ports') if lvm else {}
+            if lvm is None:
+                continue
+            agent_ports = values.get('ports')
             yield (lvm, agent_ports)
 
     @log.log
index e6b626a22bf1c7a6fe05d56deecf1ca65c7d44e5..5bb697c981ec2981314ac8a3bb3a125a522d72bb 100644 (file)
@@ -40,7 +40,6 @@ class TestL2populationRpcCallBackTunnelMixin(
             self.lvm1: {
                 self.ports[0].ip: [[self.lvms[0].mac, self.lvms[0].ip]],
                 self.local_ip: []},
-            None: {},
             self.lvm3: {
                 self.ports[2].ip: [[self.lvms[2].mac, self.lvms[2].ip]],
                 self.local_ip: []},