AGENT_TYPE_* constants[1] define all agent types BUT vendor ones are only
used by in-tree vendor code. This changes moves in-tree AGENT_TYPE_*
constants[2] to vendor modules to ensure they will be removed from neutron
code on decomposition.
[1] in neutron.common.constants
[2] AGENT_TYPE_HYPERV/MLNX/SDNVE
Change-Id: Id03fb147e11541be309c1cd22ce27e70fadc28b5
Partial-Bug: #
1487598
AGENT_TYPE_DHCP = 'DHCP agent'
AGENT_TYPE_OVS = 'Open vSwitch agent'
AGENT_TYPE_LINUXBRIDGE = 'Linux bridge agent'
-AGENT_TYPE_HYPERV = 'HyperV agent'
AGENT_TYPE_NEC = 'NEC plugin agent'
AGENT_TYPE_OFA = 'OFA driver agent'
AGENT_TYPE_L3 = 'L3 agent'
AGENT_TYPE_LOADBALANCER = 'Loadbalancer agent'
-AGENT_TYPE_MLNX = 'Mellanox plugin agent'
AGENT_TYPE_METERING = 'Metering agent'
AGENT_TYPE_METADATA = 'Metadata agent'
-AGENT_TYPE_SDNVE = 'IBM SDN-VE agent'
AGENT_TYPE_NIC_SWITCH = 'NIC Switch agent'
L2_AGENT_TOPIC = 'N/A'
from neutron.common import topics
from neutron import context
from neutron.i18n import _LE
+from neutron.plugins.ml2.drivers.hyperv import constants as h_const
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
'host': CONF.host,
'topic': n_const.L2_AGENT_TOPIC,
'configurations': configurations,
- 'agent_type': n_const.AGENT_TYPE_HYPERV,
+ 'agent_type': h_const.AGENT_TYPE_HYPERV,
'start_flag': True}
def _report_state(self):
cfg.CONF.import_group('SDNVE', 'neutron.plugins.ibm.common.config')
cfg.CONF.import_group('SDNVE_AGENT', 'neutron.plugins.ibm.common.config')
+AGENT_TYPE_SDNVE = 'IBM SDN-VE agent'
+
class SdnvePluginApi(agent_rpc.PluginApi):
'reset_br': self.reset_br,
'out_of_band': self.out_of_band,
'controller_ip': self.controller_ip},
- 'agent_type': n_const.AGENT_TYPE_SDNVE,
+ 'agent_type': AGENT_TYPE_SDNVE,
'start_flag': True}
if self.int_bridge_name:
# License for the specific language governing permissions and limitations
# under the License.
+AGENT_TYPE_HYPERV = 'hyperv'
VIF_TYPE_HYPERV = 'hyperv'
from hyperv.neutron.ml2 import mech_hyperv
-from neutron.common import constants
from neutron.extensions import portbindings
-from neutron.plugins.ml2.drivers.hyperv import constants as h_constants
+from neutron.plugins.ml2.drivers.hyperv import constants as constants
from neutron.plugins.ml2.drivers import mech_agent
def __init__(self):
super(HypervMechanismDriver, self).__init__(
constants.AGENT_TYPE_HYPERV,
- h_constants.VIF_TYPE_HYPERV,
+ constants.VIF_TYPE_HYPERV,
{portbindings.CAP_PORT_FILTER: False})
from oslo_log import log
-from neutron.common import constants as n_const
from neutron.extensions import portbindings
from neutron.plugins.common import constants as p_constants
from neutron.plugins.ml2 import driver_api as api
from neutron.plugins.ml2.drivers import mech_agent
LOG = log.getLogger(__name__)
+AGENT_TYPE_MLNX = 'Mellanox plugin agent'
VIF_TYPE_IB_HOSTDEV = 'ib_hostdev'
def __init__(self):
super(MlnxMechanismDriver, self).__init__(
- agent_type=n_const.AGENT_TYPE_MLNX,
+ agent_type=AGENT_TYPE_MLNX,
vif_type=VIF_TYPE_IB_HOSTDEV,
vif_details={portbindings.CAP_PORT_FILTER: False},
supported_vnic_types=[portbindings.VNIC_DIRECT])
import sys
import mock
-from neutron.common import constants
from neutron.extensions import portbindings
from neutron.plugins.ml2 import driver_api as api
from neutron.tests.unit.plugins.ml2 import _test_mech_agent as base
class MlnxMechanismBaseTestCase(base.AgentMechanismBaseTestCase):
VIF_TYPE = mech_mlnx.VIF_TYPE_IB_HOSTDEV
CAP_PORT_FILTER = False
- AGENT_TYPE = constants.AGENT_TYPE_MLNX
+ AGENT_TYPE = mech_mlnx.AGENT_TYPE_MLNX
VNIC_TYPE = portbindings.VNIC_DIRECT
GOOD_MAPPINGS = {'fake_physical_network': 'fake_bridge'}