]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove unneeded device_owner field from l2pop tuple
authorCarl Baldwin <carl.baldwin@hp.com>
Fri, 8 Aug 2014 17:31:59 +0000 (17:31 +0000)
committerCarl Baldwin <carl.baldwin@hp.com>
Fri, 8 Aug 2014 18:37:23 +0000 (18:37 +0000)
The DVR development added this device_owner to the middle of this
tuple during early development because it was thought to be needed.
Over the course of development, it was found to be unnecessary and
much of the code that read it from this value was removed or
obsoleted.  That job went unfinished and so this commit completes it.
This essentially restores the code to what it was before and fixes the
regression that was caused.

Change-Id: Ia901f925883b53e9880dd25688e16e0ffe402bf4
Partial-bug: #1352801

neutron/plugins/ml2/drivers/l2pop/mech_driver.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/ml2/drivers/test_l2population.py

index 18141cd862a891ea48dca94733b43daf7c2d1d9f..21058630741a887162a42aa680b80bb4110f118f 100644 (file)
@@ -45,7 +45,7 @@ class L2populationMechanismDriver(api.MechanismDriver,
         self.remove_fdb_entries = {}
 
     def _get_port_fdb_entries(self, port):
-        return [[port['mac_address'], port['device_owner'],
+        return [[port['mac_address'],
                  ip['ip_address']] for ip in port['fixed_ips']]
 
     def delete_port_precommit(self, context):
@@ -93,19 +93,17 @@ class L2populationMechanismDriver(api.MechanismDriver,
             return
         agent, agent_host, agent_ip, segment, port_fdb_entries = port_infos
 
-        orig_mac_devowner_ip = [[port['mac_address'], port['device_owner'], ip]
-                       for ip in orig_ips]
-        port_mac_devowner_ip = [[port['mac_address'], port['device_owner'], ip]
-                       for ip in port_ips]
+        orig_mac_ip = [[port['mac_address'], ip] for ip in orig_ips]
+        port_mac_ip = [[port['mac_address'], ip] for ip in port_ips]
 
         upd_fdb_entries = {port['network_id']: {agent_ip: {}}}
 
         ports = upd_fdb_entries[port['network_id']][agent_ip]
-        if orig_mac_devowner_ip:
-            ports['before'] = orig_mac_devowner_ip
+        if orig_mac_ip:
+            ports['before'] = orig_mac_ip
 
-        if port_mac_devowner_ip:
-            ports['after'] = port_mac_devowner_ip
+        if port_mac_ip:
+            ports['after'] = port_mac_ip
 
         self.L2populationAgentNotify.update_fdb_entries(
             self.rpc_ctx, {'chg_ip': upd_fdb_entries})
index d373126cfbd103f10c6efda126fe2d914d21b86f..b176b9417416aa76aa255a3b3cf2fe7e780668a5 100644 (file)
@@ -374,13 +374,12 @@ class OVSNeutronAgent(n_rpc.RpcCallback,
         else:
             self.setup_entry_for_arp_reply(br, 'add', lvm.vlan, port_info[0],
                                            port_info[1])
-            if not self.dvr_agent.is_dvr_router_interface(port_info[1]):
-                br.add_flow(table=constants.UCAST_TO_TUN,
-                            priority=2,
-                            dl_vlan=lvm.vlan,
-                            dl_dst=port_info[0],
-                            actions="strip_vlan,set_tunnel:%s,output:%s" %
-                            (lvm.segmentation_id, ofport))
+            br.add_flow(table=constants.UCAST_TO_TUN,
+                        priority=2,
+                        dl_vlan=lvm.vlan,
+                        dl_dst=port_info[0],
+                        actions="strip_vlan,set_tunnel:%s,output:%s" %
+                        (lvm.segmentation_id, ofport))
 
     def del_fdb_flow(self, br, port_info, remote_ip, lvm, ofport):
         if port_info == q_const.FLOODING_ENTRY:
index bffcaae50320cd77bb85bcf4416fa5ad09db4f88..12a88b83d39da7c27253795c7d5f4279e6ddf741 100644 (file)
@@ -180,7 +180,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                   {'ports':
                                    {'20.0.0.1': [constants.FLOODING_ENTRY,
                                                  [p1['mac_address'],
-                                                  p1['device_owner'],
                                                   p1_ips[0]]]},
                                    'network_type': 'vxlan',
                                    'segment_id': 1}}},
@@ -249,7 +248,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                    {'ports':
                                     {'20.0.0.2': [constants.FLOODING_ENTRY,
                                                   [p2['mac_address'],
-                                                   p2['device_owner'],
                                                    p2_ips[0]]]},
                                     'network_type': 'vxlan',
                                     'segment_id': 1}}},
@@ -271,7 +269,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                    {'ports':
                                     {'20.0.0.1': [constants.FLOODING_ENTRY,
                                                   [p1['mac_address'],
-                                                   p1['device_owner'],
                                                    p1_ips[0]]]},
                                     'network_type': 'vxlan',
                                     'segment_id': 1}}},
@@ -320,7 +317,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                             {'20.0.0.2':
                                              [constants.FLOODING_ENTRY,
                                               [p1['mac_address'],
-                                               p1['device_owner'],
                                                p1_ips[0]]]},
                                             'network_type': 'vxlan',
                                             'segment_id': 1}}},
@@ -345,7 +341,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                             {'20.0.0.1':
                                              [constants.FLOODING_ENTRY,
                                               [p3['mac_address'],
-                                               p3['device_owner'],
                                                p3_ips[0]]]},
                                             'network_type': 'vxlan',
                                             'segment_id': 1}}},
@@ -394,7 +389,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                  {p2['network_id']:
                                   {'ports':
                                    {'20.0.0.1': [[p2['mac_address'],
-                                                  p2['device_owner'],
                                                   p2_ips[0]]]},
                                    'network_type': 'vxlan',
                                    'segment_id': 1}}},
@@ -436,7 +430,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                   {'ports':
                                    {'20.0.0.1': [constants.FLOODING_ENTRY,
                                                  [p2['mac_address'],
-                                                  p2['device_owner'],
                                                   p2_ips[0]]]},
                                    'network_type': 'vxlan',
                                    'segment_id': 1}}},
@@ -481,7 +474,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                              {p2['network_id']:
                               {'ports':
                                {'20.0.0.1': [[p2['mac_address'],
-                                              p2['device_owner'],
                                               p2_ips[0]]]},
                                'network_type': 'vxlan',
                                'segment_id': 1}}},
@@ -519,7 +511,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                               {'ports':
                                {'20.0.0.1': [constants.FLOODING_ENTRY,
                                              [p1['mac_address'],
-                                              p1['device_owner'],
                                               p1_ips[0]]]},
                                'network_type': 'vxlan',
                                'segment_id': 1}}},
@@ -561,7 +552,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                   {p1['network_id']:
                                    {'20.0.0.1':
                                     {'after': [[p1['mac_address'],
-                                                p1['device_owner'],
                                                 '10.0.0.10']]}}}}},
                                 'namespace': None,
                                 'method': 'update_fdb_entries'}
@@ -584,10 +574,8 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                   {p1['network_id']:
                                    {'20.0.0.1':
                                     {'before': [[p1['mac_address'],
-                                                 p1['device_owner'],
                                                  '10.0.0.10']],
                                      'after': [[p1['mac_address'],
-                                                p1['device_owner'],
                                                 '10.0.0.16']]}}}}},
                                 'namespace': None,
                                 'method': 'update_fdb_entries'}
@@ -609,7 +597,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                   {p1['network_id']:
                                    {'20.0.0.1':
                                     {'before': [[p1['mac_address'],
-                                                 p1['device_owner'],
                                                  '10.0.0.2']]}}}}},
                                 'namespace': None,
                                 'method': 'update_fdb_entries'}
@@ -690,7 +677,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                   {'ports':
                                    {'20.0.0.1': [constants.FLOODING_ENTRY,
                                                  [p1['mac_address'],
-                                                  p1['device_owner'],
                                                   p1_ips[0]]]},
                                    'network_type': 'vxlan',
                                    'segment_id': 1}}},
@@ -749,7 +735,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                   {'ports':
                                    {'20.0.0.1': [constants.FLOODING_ENTRY,
                                                  [p1['mac_address'],
-                                                  p1['device_owner'],
                                                   p1_ips[0]]]},
                                    'network_type': 'vxlan',
                                    'segment_id': 1}}},