]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Merge "Refactor l2_pop code to pass mac/ip info more readably"
authorJenkins <jenkins@review.openstack.org>
Fri, 21 Nov 2014 09:32:08 +0000 (09:32 +0000)
committerGerrit Code Review <review@openstack.org>
Fri, 21 Nov 2014 09:32:09 +0000 (09:32 +0000)
1  2 
neutron/agent/l2population_rpc.py
neutron/common/constants.py
neutron/plugins/ofagent/agent/ofa_neutron_agent.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/ml2/drivers/test_l2population.py
neutron/tests/unit/ofagent/test_ofa_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py

index c94d29bb1becee4fb2cc272986b514e45880e9d8,6cc64fc689b099c402e9e2928cd77ed5a55f51be..2ffcd2be407ed6a76e4e2c16e8256036f00f6794
@@@ -117,11 -128,12 +145,13 @@@ class L2populationRpcCallBackTunnelMixi
  
          :param br: represent the bridge on which del_fdb_flow should be
          applied.
-         :param port_info: a list to contain mac and ip.
-             [mac, ip]
+         :param port_info: PortInfo instance to include mac and ip.
+             .mac_address
+             .ip_address
          :remote_ip: remote ip address.
 -        :param lvm: local VLAN map of network.
 +        :param lvm: local VLAN map of a network. See add_fdb_flow for
 +            more explanation.
          :param ofport: a port to delete.
          '''
          pass
                                  'net2':
                                  ...
                                 }
+                              PortInfo has .mac_address and .ip_address attrs.
          :param local_ip: local IP address of this agent.
 -        :local_vlan_map: local VLAN map of network.
 +        :param local_vlan_map: A dict to map network_id to
 +            the corresponding lvm entry.
          '''
  
          for network_id, agent_ports in fdb_entries.items():
index e424450d25a39a68fd1ce9013178e4e2a37c1ac5,2935760c605c62a2dcfeabea7605af9908236888..fc820566966e9170f9f7ccd48c3a5483171c089b
@@@ -70,8 -70,21 +70,8 @@@ MAX_GRE_ID = 2 ** 32 - 
  MIN_VXLAN_VNI = 1
  MAX_VXLAN_VNI = 2 ** 24 - 1
  
- FLOODING_ENTRY = ['00:00:00:00:00:00', '0.0.0.0']
+ FLOODING_ENTRY = ('00:00:00:00:00:00', '0.0.0.0')
  
 -EXT_NS_COMP = '_backward_comp_e_ns'
 -EXT_NS = '_extension_ns'
 -XML_NS_V20 = 'http://openstack.org/quantum/api/v2.0'
 -XSI_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance"
 -XSI_ATTR = "xsi:nil"
 -XSI_NIL_ATTR = "xmlns:xsi"
 -ATOM_NAMESPACE = "http://www.w3.org/2005/Atom"
 -ATOM_XMLNS = "xmlns:atom"
 -ATOM_LINK_NOTATION = "{%s}link" % ATOM_NAMESPACE
 -TYPE_XMLNS = "xmlns:quantum"
 -TYPE_ATTR = "quantum:type"
 -VIRTUAL_ROOT_KEY = "_v_root"
 -
  TYPE_BOOL = "bool"
  TYPE_INT = "int"
  TYPE_LONG = "long"
index fa5a8be995c09de4d0746bcedabeb5edcbb3a5af,1073a0e488f9e6bc5806fa60ad62f29ed31078ca..70aa4945a76386b79f0ad32780a50e24aa9ec385
@@@ -24,10 -25,12 +25,11 @@@ from neutron.extensions import portbind
  from neutron.extensions import providernet as pnet
  from neutron import manager
  from neutron.openstack.common import timeutils
 -from neutron.plugins.ml2 import config as config
  from neutron.plugins.ml2.drivers.l2pop import mech_driver as l2pop_mech_driver
+ from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc
  from neutron.plugins.ml2 import managers
  from neutron.plugins.ml2 import rpc
 -from neutron.tests.unit import test_db_plugin as test_plugin
 +from neutron.tests.unit.ml2 import test_ml2_plugin as test_plugin
  
  HOST = 'my_l2_host'
  L2_AGENT = {
@@@ -90,13 -93,24 +92,15 @@@ L2_AGENT_5 = 
  NOTIFIER = 'neutron.plugins.ml2.rpc.AgentNotifierApi'
  DEVICE_OWNER_COMPUTE = 'compute:None'
  
+ FLOODING_ENTRY_AS_LIST = list(constants.FLOODING_ENTRY)
  
 -class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
 +class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase):
 +    _mechanism_drivers = ['openvswitch', 'linuxbridge',
 +                          'ofagent', 'l2population']
  
      def setUp(self):
 -        # Enable the test mechanism driver to ensure that
 -        # we can successfully call through to all mechanism
 -        # driver apis.
 -        config.cfg.CONF.set_override('mechanism_drivers',
 -                                     ['openvswitch', 'linuxbridge',
 -                                      'ofagent', 'l2population'],
 -                                     'ml2')
 -        config.cfg.CONF.set_override('network_vlan_ranges',
 -                                     ['phys1:1:100'],
 -                                     'ml2_type_vlan')
 -        super(TestL2PopulationRpcTestCase, self).setUp(PLUGIN_NAME)
 +        super(TestL2PopulationRpcTestCase, self).setUp()
  
          self.adminContext = context.get_admin_context()