Divide vmware_nsx/plugins into plugin-specific subdirectories

This patch will create:
vmware_nsx/plugins/dvs for DVS specific files
vmware_nsx/plugins/nsx_mh for MH specific files
vmware_nsx/plugins/nsx_v for nsx_v specific files
vmware_nsx/plugins/nsx_v3 for nsx_v3 specific files

also move vmware_nsx/vsphere/ to vmware_nsx/plugins/nsx_v/vsphere/.

This is part of new vmware_nsx directory structure proposed in
https://goo.gl/GdWXyH.

Change-Id: I00ee12da2eea0add988bae3d4f3e12940ea829bb
This commit is contained in:
Shih-Hao Li 2015-09-16 16:14:47 -07:00
parent c7ed3b42f3
commit 09d19bb138
46 changed files with 82 additions and 83 deletions

View File

@ -62,7 +62,7 @@ function neutron_plugin_configure_common {
Q_PLUGIN_SRC_CONF_PATH=vmware-nsx/etc Q_PLUGIN_SRC_CONF_PATH=vmware-nsx/etc
mkdir -p /$Q_PLUGIN_CONF_PATH mkdir -p /$Q_PLUGIN_CONF_PATH
cp $DEST/$Q_PLUGIN_SRC_CONF_PATH/$Q_PLUGIN_CONF_FILENAME /$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME cp $DEST/$Q_PLUGIN_SRC_CONF_PATH/$Q_PLUGIN_CONF_FILENAME /$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME
Q_PLUGIN_CLASS="vmware_nsx.plugins.nsx_v3_plugin.NsxV3Plugin" Q_PLUGIN_CLASS="vmware_nsx.plugin.NsxV3Plugin"
} }
function neutron_plugin_configure_debug_command { function neutron_plugin_configure_debug_command {

View File

@ -35,9 +35,9 @@ neutron.service_plugins =
vmware_nsx_l2gw = vmware_nsx.services.l2gateway.common.plugin:NsxL2GatewayPlugin vmware_nsx_l2gw = vmware_nsx.services.l2gateway.common.plugin:NsxL2GatewayPlugin
vmware_nsx_qos = vmware_nsx.services.qos.plugin:NsxQosPlugin vmware_nsx_qos = vmware_nsx.services.qos.plugin:NsxQosPlugin
vmware_nsx.neutron.nsxv.router_type_drivers = vmware_nsx.neutron.nsxv.router_type_drivers =
shared = vmware_nsx.plugins.nsx_v_drivers.shared_router_driver:RouterSharedDriver shared = vmware_nsx.plugins.nsx_v.drivers.shared_router_driver:RouterSharedDriver
distributed = vmware_nsx.plugins.nsx_v_drivers.distributed_router_driver:RouterDistributedDriver distributed = vmware_nsx.plugins.nsx_v.drivers.distributed_router_driver:RouterDistributedDriver
exclusive = vmware_nsx.plugins.nsx_v_drivers.exclusive_router_driver:RouterExclusiveDriver exclusive = vmware_nsx.plugins.nsx_v.drivers.exclusive_router_driver:RouterExclusiveDriver
[build_sphinx] [build_sphinx]
source-dir = doc/source source-dir = doc/source
build-dir = doc/build build-dir = doc/build

View File

@ -27,7 +27,7 @@ from neutron.i18n import _, _LE
from vmware_nsx.common import exceptions as nsx_exc from vmware_nsx.common import exceptions as nsx_exc
from vmware_nsx.common import nsxv_constants from vmware_nsx.common import nsxv_constants
from vmware_nsx.db import nsxv_models from vmware_nsx.db import nsxv_models
from vmware_nsx.vshield.common import constants from vmware_nsx.plugins.nsx_v.vshield.common import constants
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -15,12 +15,12 @@
# under the License. # under the License.
# #
from vmware_nsx.plugins import base from vmware_nsx.plugins.dvs import plugin as dvs
from vmware_nsx.plugins import dvs from vmware_nsx.plugins.nsx_mh import plugin as nsx_mh
from vmware_nsx.plugins import nsx_v from vmware_nsx.plugins.nsx_v import plugin as nsx_v
from vmware_nsx.plugins import nsx_v3_plugin from vmware_nsx.plugins.nsx_v3 import plugin as nsx_v3
NsxPlugin = base.NsxPluginV2
NsxVPlugin = nsx_v.NsxVPluginV2
NsxDvsPlugin = dvs.NsxDvsV2 NsxDvsPlugin = dvs.NsxDvsV2
NsxV3Plugin = nsx_v3_plugin.NsxV3Plugin NsxPlugin = nsx_mh.NsxPluginV2
NsxVPlugin = nsx_v.NsxVPluginV2
NsxV3Plugin = nsx_v3.NsxV3Plugin

View File

@ -21,12 +21,12 @@ from neutron.db import l3_db
from neutron.i18n import _LE from neutron.i18n import _LE
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
from vmware_nsx.plugins import nsx_v from vmware_nsx.plugins.nsx_v.drivers import (
from vmware_nsx.plugins.nsx_v_drivers import (
abstract_router_driver as router_driver) abstract_router_driver as router_driver)
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v import plugin as nsx_v
from vmware_nsx.plugins.nsx_v.vshield.common import (
constants as vcns_const) constants as vcns_const)
from vmware_nsx.vshield import edge_utils from vmware_nsx.plugins.nsx_v.vshield import edge_utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
METADATA_CIDR = '169.254.169.254/32' METADATA_CIDR = '169.254.169.254/32'

View File

@ -19,10 +19,10 @@ from neutron.api.v2 import attributes as attr
from vmware_nsx.common import exceptions as nsxv_exc from vmware_nsx.common import exceptions as nsxv_exc
from vmware_nsx.common import locking from vmware_nsx.common import locking
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
from vmware_nsx.plugins import nsx_v from vmware_nsx.plugins.nsx_v.drivers import (
from vmware_nsx.plugins.nsx_v_drivers import (
abstract_router_driver as router_driver) abstract_router_driver as router_driver)
from vmware_nsx.vshield import edge_utils from vmware_nsx.plugins.nsx_v import plugin as nsx_v
from vmware_nsx.plugins.nsx_v.vshield import edge_utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -23,13 +23,13 @@ from vmware_nsx.common import exceptions as nsx_exc
from vmware_nsx.common import locking from vmware_nsx.common import locking
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
from vmware_nsx.db import nsxv_models from vmware_nsx.db import nsxv_models
from vmware_nsx.plugins import nsx_v from vmware_nsx.plugins.nsx_v.drivers import (
from vmware_nsx.plugins.nsx_v_drivers import (
abstract_router_driver as router_driver) abstract_router_driver as router_driver)
from vmware_nsx.plugins import nsx_v_md_proxy from vmware_nsx.plugins.nsx_v import md_proxy as nsx_v_md_proxy
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v import plugin as nsx_v
from vmware_nsx.plugins.nsx_v.vshield.common import (
constants as vcns_const) constants as vcns_const)
from vmware_nsx.vshield import edge_utils from vmware_nsx.plugins.nsx_v.vshield import edge_utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -29,11 +29,11 @@ from vmware_nsx.common import exceptions as nsxv_exc
from vmware_nsx.common import locking from vmware_nsx.common import locking
from vmware_nsx.common import nsxv_constants from vmware_nsx.common import nsxv_constants
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
from vmware_nsx.vshield import ( from vmware_nsx.plugins.nsx_v.vshield import (
nsxv_loadbalancer as nsxv_lb) nsxv_loadbalancer as nsxv_lb)
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v.vshield.common import (
constants as vcns_const) constants as vcns_const)
from vmware_nsx.vshield import edge_utils from vmware_nsx.plugins.nsx_v.vshield import edge_utils
METADATA_VSE_NAME = 'MdSrv' METADATA_VSE_NAME = 'MdSrv'
METADATA_IP_ADDR = '169.254.169.254' METADATA_IP_ADDR = '169.254.169.254'

View File

@ -65,15 +65,15 @@ from vmware_nsx.extensions import (
advancedserviceproviders as as_providers) advancedserviceproviders as as_providers)
from vmware_nsx.extensions import ( from vmware_nsx.extensions import (
vnicindex as ext_vnic_idx) vnicindex as ext_vnic_idx)
from vmware_nsx.plugins import managers from vmware_nsx.plugins.nsx_v import managers
from vmware_nsx.plugins import nsx_v_md_proxy from vmware_nsx.plugins.nsx_v import md_proxy as nsx_v_md_proxy
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v.vshield.common import (
constants as vcns_const) constants as vcns_const)
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v.vshield.common import (
exceptions as vsh_exc) exceptions as vsh_exc)
from vmware_nsx.vshield import edge_utils from vmware_nsx.plugins.nsx_v.vshield import edge_utils
from vmware_nsx.vshield import securitygroup_utils from vmware_nsx.plugins.nsx_v.vshield import securitygroup_utils
from vmware_nsx.vshield import vcns_driver from vmware_nsx.plugins.nsx_v.vshield import vcns_driver
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
PORTGROUP_PREFIX = 'dvportgroup' PORTGROUP_PREFIX = 'dvportgroup'

View File

@ -18,7 +18,7 @@ import eventlet
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six import six
from vmware_nsx.vshield.common import exceptions from vmware_nsx.plugins.nsx_v.vshield.common import exceptions
httplib2 = eventlet.import_patched('httplib2') httplib2 = eventlet.import_patched('httplib2')

View File

@ -24,11 +24,11 @@ from oslo_utils import excutils
from neutron.i18n import _LE, _LI, _LW from neutron.i18n import _LE, _LI, _LW
from vmware_nsx.common import nsxv_constants from vmware_nsx.common import nsxv_constants
from vmware_nsx.common import utils from vmware_nsx.common import utils
from vmware_nsx.vshield.common import constants from vmware_nsx.plugins.nsx_v.vshield.common import constants
from vmware_nsx.vshield.common import exceptions from vmware_nsx.plugins.nsx_v.vshield.common import exceptions
from vmware_nsx.vshield.tasks import ( from vmware_nsx.plugins.nsx_v.vshield.tasks import (
constants as task_constants) constants as task_constants)
from vmware_nsx.vshield.tasks import tasks from vmware_nsx.plugins.nsx_v.vshield.tasks import tasks
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,11 +18,11 @@ from oslo_utils import excutils
from neutron.i18n import _, _LE from neutron.i18n import _, _LE
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v.vshield.common import (
exceptions as vcns_exc) exceptions as vcns_exc)
from vmware_nsx.vshield.tasks import ( from vmware_nsx.plugins.nsx_v.vshield.tasks import (
constants as task_const) constants as task_const)
from vmware_nsx.vshield.tasks import tasks from vmware_nsx.plugins.nsx_v.vshield.tasks import tasks
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -16,7 +16,7 @@ from oslo_log import log as logging
from oslo_utils import excutils from oslo_utils import excutils
from neutron.i18n import _LE, _LW from neutron.i18n import _LE, _LW
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v.vshield.common import (
exceptions as vcns_exc) exceptions as vcns_exc)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -25,9 +25,9 @@ from neutron import manager
from neutron.plugins.common import constants from neutron.plugins.common import constants
from vmware_nsx.common import locking from vmware_nsx.common import locking
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v.vshield.common import (
exceptions as nsxv_exc) exceptions as nsxv_exc)
from vmware_nsx.vshield import vcns as nsxv_api from vmware_nsx.plugins.nsx_v.vshield import vcns as nsxv_api
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -37,12 +37,12 @@ from vmware_nsx.common import locking
from vmware_nsx.common import nsxv_constants from vmware_nsx.common import nsxv_constants
from vmware_nsx.db import db as nsx_db from vmware_nsx.db import db as nsx_db
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v.vshield.common import (
constants as vcns_const) constants as vcns_const)
from vmware_nsx.vshield.tasks import ( from vmware_nsx.plugins.nsx_v.vshield.tasks import (
constants as task_const) constants as task_const)
from vmware_nsx.vshield.tasks import tasks from vmware_nsx.plugins.nsx_v.vshield.tasks import tasks
from vmware_nsx.vshield import vcns from vmware_nsx.plugins.nsx_v.vshield import vcns
WORKER_POOL_SIZE = 8 WORKER_POOL_SIZE = 8
RP_FILTER_PROPERTY_OFF_TEMPLATE = 'sysctl.net.ipv4.conf.%s.rp_filter=%s' RP_FILTER_PROPERTY_OFF_TEMPLATE = 'sysctl.net.ipv4.conf.%s.rp_filter=%s'

View File

@ -18,7 +18,7 @@ import abc
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six import six
from vmware_nsx.vshield import vcns from vmware_nsx.plugins.nsx_v.vshield import vcns
@six.add_metaclass(abc.ABCMeta) @six.add_metaclass(abc.ABCMeta)

View File

@ -16,7 +16,7 @@
from oslo_log import log as logging from oslo_log import log as logging
from vmware_nsx.vshield import nsxv_edge_cfg_obj from vmware_nsx.plugins.nsx_v.vshield import nsxv_edge_cfg_obj
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -24,7 +24,7 @@ from oslo_service import loopingcall
import six import six
from neutron.i18n import _LE, _LI from neutron.i18n import _LE, _LI
from vmware_nsx.vshield.tasks import constants from vmware_nsx.plugins.nsx_v.vshield.tasks import constants
DEFAULT_INTERVAL = 1000 DEFAULT_INTERVAL = 1000

View File

@ -20,8 +20,8 @@ from oslo_serialization import jsonutils
import retrying import retrying
import xml.etree.ElementTree as et import xml.etree.ElementTree as et
from vmware_nsx.vshield.common import exceptions from vmware_nsx.plugins.nsx_v.vshield.common import exceptions
from vmware_nsx.vshield.common import VcnsApiClient from vmware_nsx.plugins.nsx_v.vshield.common import VcnsApiClient
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -20,11 +20,11 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from vmware_nsx.common import config # noqa from vmware_nsx.common import config # noqa
from vmware_nsx.vshield import edge_appliance_driver from vmware_nsx.plugins.nsx_v.vshield import edge_appliance_driver
from vmware_nsx.vshield import edge_firewall_driver from vmware_nsx.plugins.nsx_v.vshield import edge_firewall_driver
from vmware_nsx.vshield import edge_loadbalancer_driver from vmware_nsx.plugins.nsx_v.vshield import edge_loadbalancer_driver
from vmware_nsx.vshield.tasks import tasks from vmware_nsx.plugins.nsx_v.vshield.tasks import tasks
from vmware_nsx.vshield import vcns from vmware_nsx.plugins.nsx_v.vshield import vcns
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

View File

@ -22,11 +22,11 @@ from vmware_nsx.api_client import client as nsx_client
from vmware_nsx.api_client import eventlet_client from vmware_nsx.api_client import eventlet_client
from vmware_nsx import extensions from vmware_nsx import extensions
import vmware_nsx.plugin as neutron_plugin import vmware_nsx.plugin as neutron_plugin
from vmware_nsx.vshield.common import ( from vmware_nsx.plugins.nsx_v.vshield.common import (
VcnsApiClient as vcnsapi) VcnsApiClient as vcnsapi)
from vmware_nsx.vshield import edge_utils from vmware_nsx.plugins.nsx_v.vshield import edge_utils
from vmware_nsx.vshield import vcns from vmware_nsx.plugins.nsx_v.vshield import vcns
import vmware_nsx.vshield.vcns_driver as vcnsdriver import vmware_nsx.plugins.nsx_v.vshield.vcns_driver as vcnsdriver
plugin = neutron_plugin.NsxPlugin plugin = neutron_plugin.NsxPlugin

View File

@ -18,7 +18,7 @@ import mock
from neutron import context from neutron import context
from neutron.tests import base from neutron.tests import base
from vmware_nsx.vshield import vcns_driver from vmware_nsx.plugins.nsx_v.vshield import vcns_driver
EDGE_PROVIDER = ('LOADBALANCER:vmwareedge:neutron.services.' EDGE_PROVIDER = ('LOADBALANCER:vmwareedge:neutron.services.'
'loadbalancer.drivers.vmware.edge_driver.' 'loadbalancer.drivers.vmware.edge_driver.'

View File

@ -17,8 +17,8 @@ import mock
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from neutron.tests import base from neutron.tests import base
from vmware_nsx.vshield import nsxv_loadbalancer from vmware_nsx.plugins.nsx_v.vshield import nsxv_loadbalancer
from vmware_nsx.vshield import vcns from vmware_nsx.plugins.nsx_v.vshield import vcns
class NsxvLoadbalancerTestCase(base.BaseTestCase): class NsxvLoadbalancerTestCase(base.BaseTestCase):

View File

@ -15,8 +15,8 @@
from neutron.tests import base from neutron.tests import base
from vmware_nsx.vshield.common import exceptions from vmware_nsx.plugins.nsx_v.vshield.common import exceptions
from vmware_nsx.vshield import vcns from vmware_nsx.plugins.nsx_v.vshield import vcns
def raise_until_attempt(attempt, exception): def raise_until_attempt(attempt, exception):

View File

@ -39,8 +39,7 @@ from vmware_nsx.nsxlib.v3 import dfw_api as firewall
from vmware_nsx.tests.unit import vmware from vmware_nsx.tests.unit import vmware
from vmware_nsx.tests.unit.vmware import nsx_v3_mocks from vmware_nsx.tests.unit.vmware import nsx_v3_mocks
PLUGIN_NAME = ('vmware_nsx.' PLUGIN_NAME = ('vmware_nsx.plugin.NsxV3Plugin')
'plugins.nsx_v3_plugin.NsxV3Plugin')
class NsxPluginV3TestCase(test_plugin.NeutronDbPluginV2TestCase): class NsxPluginV3TestCase(test_plugin.NeutronDbPluginV2TestCase):

View File

@ -51,13 +51,13 @@ from vmware_nsx.extensions import (
routertype as router_type) routertype as router_type)
from vmware_nsx.extensions import ( from vmware_nsx.extensions import (
vnicindex as ext_vnic_idx) vnicindex as ext_vnic_idx)
from vmware_nsx.plugins.nsx_v.vshield.common import (
constants as vcns_const)
from vmware_nsx.plugins.nsx_v.vshield import edge_utils
from vmware_nsx.tests.unit import vmware from vmware_nsx.tests.unit import vmware
from vmware_nsx.tests.unit.vmware.extensions import test_vnic_index from vmware_nsx.tests.unit.vmware.extensions import test_vnic_index
from vmware_nsx.tests.unit.vmware import test_utils from vmware_nsx.tests.unit.vmware import test_utils
from vmware_nsx.tests.unit.vmware.vshield import fake_vcns from vmware_nsx.tests.unit.vmware.vshield import fake_vcns
from vmware_nsx.vshield.common import (
constants as vcns_const)
from vmware_nsx.vshield import edge_utils
PLUGIN_NAME = 'vmware_nsx.plugin.NsxVPlugin' PLUGIN_NAME = 'vmware_nsx.plugin.NsxVPlugin'

View File

@ -19,7 +19,7 @@ from oslo_utils import uuidutils
import six import six
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
from vmware_nsx.vshield.common import exceptions from vmware_nsx.plugins.nsx_v.vshield.common import exceptions
SECTION_LOCATION_HEADER = '/api/4.0/firewall/globalroot-0/config/%s/%s' SECTION_LOCATION_HEADER = '/api/4.0/firewall/globalroot-0/config/%s/%s'

View File

@ -24,10 +24,10 @@ from neutron.plugins.common import constants as plugin_const
from neutron.tests.unit import testlib_api from neutron.tests.unit import testlib_api
from vmware_nsx.common import nsxv_constants from vmware_nsx.common import nsxv_constants
from vmware_nsx.db import nsxv_db from vmware_nsx.db import nsxv_db
from vmware_nsx.tests.unit import vmware from vmware_nsx.plugins.nsx_v.vshield.common import (
from vmware_nsx.vshield.common import (
constants as vcns_const) constants as vcns_const)
from vmware_nsx.vshield import edge_utils from vmware_nsx.plugins.nsx_v.vshield import edge_utils
from vmware_nsx.tests.unit import vmware
_uuid = uuidutils.generate_uuid _uuid = uuidutils.generate_uuid

View File

@ -19,14 +19,14 @@ import mock
from neutron.tests import base from neutron.tests import base
import six import six
from vmware_nsx.plugins.nsx_v.vshield.common import (
constants as vcns_const)
from vmware_nsx.plugins.nsx_v.vshield.tasks import (
constants as ts_const)
from vmware_nsx.plugins.nsx_v.vshield.tasks import tasks as ts
from vmware_nsx.plugins.nsx_v.vshield import vcns_driver
from vmware_nsx.tests.unit import vmware from vmware_nsx.tests.unit import vmware
from vmware_nsx.tests.unit.vmware.vshield import fake_vcns from vmware_nsx.tests.unit.vmware.vshield import fake_vcns
from vmware_nsx.vshield.common import (
constants as vcns_const)
from vmware_nsx.vshield.tasks import (
constants as ts_const)
from vmware_nsx.vshield.tasks import tasks as ts
from vmware_nsx.vshield import vcns_driver
VCNS_CONFIG_FILE = vmware.get_fake_conf("vcns.ini.test") VCNS_CONFIG_FILE = vmware.get_fake_conf("vcns.ini.test")