From 09d19bb1384045ae7ccda9a741a23ab3dfb934e1 Mon Sep 17 00:00:00 2001 From: Shih-Hao Li Date: Wed, 16 Sep 2015 16:14:47 -0700 Subject: [PATCH] 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 --- devstack/lib/vmware_nsx_v3 | 2 +- setup.cfg | 6 +++--- vmware_nsx/db/nsxv_db.py | 2 +- vmware_nsx/plugin.py | 14 +++++++------- .../plugins/{nsx_v_drivers => dvs}/__init__.py | 0 vmware_nsx/plugins/{dvs.py => dvs/plugin.py} | 0 vmware_nsx/{vshield => plugins/nsx_mh}/__init__.py | 0 vmware_nsx/plugins/{base.py => nsx_mh/plugin.py} | 0 .../{vshield/common => plugins/nsx_v}/__init__.py | 0 .../tasks => plugins/nsx_v/drivers}/__init__.py | 0 .../drivers}/abstract_router_driver.py | 0 .../drivers}/distributed_router_driver.py | 8 ++++---- .../drivers}/exclusive_router_driver.py | 6 +++--- .../drivers}/shared_router_driver.py | 10 +++++----- vmware_nsx/plugins/{ => nsx_v}/managers.py | 0 .../{nsx_v_md_proxy.py => nsx_v/md_proxy.py} | 6 +++--- vmware_nsx/plugins/{nsx_v.py => nsx_v/plugin.py} | 14 +++++++------- vmware_nsx/plugins/nsx_v/vshield/__init__.py | 0 .../nsx_v}/vshield/common/VcnsApiClient.py | 2 +- .../plugins/nsx_v/vshield/common/__init__.py | 0 .../nsx_v}/vshield/common/constants.py | 0 .../nsx_v}/vshield/common/exceptions.py | 0 .../nsx_v}/vshield/edge_appliance_driver.py | 8 ++++---- .../nsx_v}/vshield/edge_firewall_driver.py | 6 +++--- .../nsx_v}/vshield/edge_ipsecvpn_driver.py | 2 +- .../nsx_v}/vshield/edge_loadbalancer_driver.py | 4 ++-- .../{ => plugins/nsx_v}/vshield/edge_utils.py | 8 ++++---- .../nsx_v}/vshield/nsxv_edge_cfg_obj.py | 2 +- .../nsx_v}/vshield/nsxv_loadbalancer.py | 2 +- .../nsx_v}/vshield/securitygroup_utils.py | 0 vmware_nsx/plugins/nsx_v/vshield/tasks/__init__.py | 0 .../{ => plugins/nsx_v}/vshield/tasks/constants.py | 0 .../{ => plugins/nsx_v}/vshield/tasks/tasks.py | 2 +- vmware_nsx/{ => plugins/nsx_v}/vshield/vcns.py | 4 ++-- .../{ => plugins/nsx_v}/vshield/vcns_driver.py | 10 +++++----- vmware_nsx/plugins/nsx_v3/__init__.py | 0 .../plugins/{nsx_v3_plugin.py => nsx_v3/plugin.py} | 0 vmware_nsx/tests/unit/vmware/__init__.py | 8 ++++---- .../vmware/nsx_v/test_edge_loadbalancer_driver.py | 2 +- .../unit/vmware/nsx_v/test_nsxv_loadbalancer.py | 4 ++-- vmware_nsx/tests/unit/vmware/test_nsx_misc.py | 4 ++-- vmware_nsx/tests/unit/vmware/test_nsx_v3_plugin.py | 3 +-- vmware_nsx/tests/unit/vmware/test_nsx_v_plugin.py | 6 +++--- vmware_nsx/tests/unit/vmware/vshield/fake_vcns.py | 2 +- .../tests/unit/vmware/vshield/test_edge_utils.py | 6 +++--- .../tests/unit/vmware/vshield/test_vcns_driver.py | 12 ++++++------ 46 files changed, 82 insertions(+), 83 deletions(-) rename vmware_nsx/plugins/{nsx_v_drivers => dvs}/__init__.py (100%) rename vmware_nsx/plugins/{dvs.py => dvs/plugin.py} (100%) rename vmware_nsx/{vshield => plugins/nsx_mh}/__init__.py (100%) rename vmware_nsx/plugins/{base.py => nsx_mh/plugin.py} (100%) rename vmware_nsx/{vshield/common => plugins/nsx_v}/__init__.py (100%) rename vmware_nsx/{vshield/tasks => plugins/nsx_v/drivers}/__init__.py (100%) rename vmware_nsx/plugins/{nsx_v_drivers => nsx_v/drivers}/abstract_router_driver.py (100%) rename vmware_nsx/plugins/{nsx_v_drivers => nsx_v/drivers}/distributed_router_driver.py (98%) rename vmware_nsx/plugins/{nsx_v_drivers => nsx_v/drivers}/exclusive_router_driver.py (98%) rename vmware_nsx/plugins/{nsx_v_drivers => nsx_v/drivers}/shared_router_driver.py (99%) rename vmware_nsx/plugins/{ => nsx_v}/managers.py (100%) rename vmware_nsx/plugins/{nsx_v_md_proxy.py => nsx_v/md_proxy.py} (99%) rename vmware_nsx/plugins/{nsx_v.py => nsx_v/plugin.py} (99%) create mode 100644 vmware_nsx/plugins/nsx_v/vshield/__init__.py rename vmware_nsx/{ => plugins/nsx_v}/vshield/common/VcnsApiClient.py (98%) create mode 100644 vmware_nsx/plugins/nsx_v/vshield/common/__init__.py rename vmware_nsx/{ => plugins/nsx_v}/vshield/common/constants.py (100%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/common/exceptions.py (100%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/edge_appliance_driver.py (99%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/edge_firewall_driver.py (99%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/edge_ipsecvpn_driver.py (99%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/edge_loadbalancer_driver.py (99%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/edge_utils.py (99%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/nsxv_edge_cfg_obj.py (97%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/nsxv_loadbalancer.py (99%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/securitygroup_utils.py (100%) create mode 100644 vmware_nsx/plugins/nsx_v/vshield/tasks/__init__.py rename vmware_nsx/{ => plugins/nsx_v}/vshield/tasks/constants.py (100%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/tasks/tasks.py (99%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/vcns.py (99%) rename vmware_nsx/{ => plugins/nsx_v}/vshield/vcns_driver.py (88%) create mode 100644 vmware_nsx/plugins/nsx_v3/__init__.py rename vmware_nsx/plugins/{nsx_v3_plugin.py => nsx_v3/plugin.py} (100%) diff --git a/devstack/lib/vmware_nsx_v3 b/devstack/lib/vmware_nsx_v3 index d27b5de75e..103f6eb036 100644 --- a/devstack/lib/vmware_nsx_v3 +++ b/devstack/lib/vmware_nsx_v3 @@ -62,7 +62,7 @@ function neutron_plugin_configure_common { Q_PLUGIN_SRC_CONF_PATH=vmware-nsx/etc 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 - Q_PLUGIN_CLASS="vmware_nsx.plugins.nsx_v3_plugin.NsxV3Plugin" + Q_PLUGIN_CLASS="vmware_nsx.plugin.NsxV3Plugin" } function neutron_plugin_configure_debug_command { diff --git a/setup.cfg b/setup.cfg index d08285d1c9..9029fed698 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,9 +35,9 @@ neutron.service_plugins = vmware_nsx_l2gw = vmware_nsx.services.l2gateway.common.plugin:NsxL2GatewayPlugin vmware_nsx_qos = vmware_nsx.services.qos.plugin:NsxQosPlugin vmware_nsx.neutron.nsxv.router_type_drivers = - shared = vmware_nsx.plugins.nsx_v_drivers.shared_router_driver:RouterSharedDriver - distributed = vmware_nsx.plugins.nsx_v_drivers.distributed_router_driver:RouterDistributedDriver - exclusive = vmware_nsx.plugins.nsx_v_drivers.exclusive_router_driver:RouterExclusiveDriver + shared = vmware_nsx.plugins.nsx_v.drivers.shared_router_driver:RouterSharedDriver + distributed = vmware_nsx.plugins.nsx_v.drivers.distributed_router_driver:RouterDistributedDriver + exclusive = vmware_nsx.plugins.nsx_v.drivers.exclusive_router_driver:RouterExclusiveDriver [build_sphinx] source-dir = doc/source build-dir = doc/build diff --git a/vmware_nsx/db/nsxv_db.py b/vmware_nsx/db/nsxv_db.py index 4a0535c077..24ec95e9f8 100644 --- a/vmware_nsx/db/nsxv_db.py +++ b/vmware_nsx/db/nsxv_db.py @@ -27,7 +27,7 @@ from neutron.i18n import _, _LE from vmware_nsx.common import exceptions as nsx_exc from vmware_nsx.common import nsxv_constants 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__) diff --git a/vmware_nsx/plugin.py b/vmware_nsx/plugin.py index 0c2e28c5b0..0c71981dbf 100644 --- a/vmware_nsx/plugin.py +++ b/vmware_nsx/plugin.py @@ -15,12 +15,12 @@ # under the License. # -from vmware_nsx.plugins import base -from vmware_nsx.plugins import dvs -from vmware_nsx.plugins import nsx_v -from vmware_nsx.plugins import nsx_v3_plugin +from vmware_nsx.plugins.dvs import plugin as dvs +from vmware_nsx.plugins.nsx_mh import plugin as nsx_mh +from vmware_nsx.plugins.nsx_v import plugin as nsx_v +from vmware_nsx.plugins.nsx_v3 import plugin as nsx_v3 -NsxPlugin = base.NsxPluginV2 -NsxVPlugin = nsx_v.NsxVPluginV2 NsxDvsPlugin = dvs.NsxDvsV2 -NsxV3Plugin = nsx_v3_plugin.NsxV3Plugin +NsxPlugin = nsx_mh.NsxPluginV2 +NsxVPlugin = nsx_v.NsxVPluginV2 +NsxV3Plugin = nsx_v3.NsxV3Plugin diff --git a/vmware_nsx/plugins/nsx_v_drivers/__init__.py b/vmware_nsx/plugins/dvs/__init__.py similarity index 100% rename from vmware_nsx/plugins/nsx_v_drivers/__init__.py rename to vmware_nsx/plugins/dvs/__init__.py diff --git a/vmware_nsx/plugins/dvs.py b/vmware_nsx/plugins/dvs/plugin.py similarity index 100% rename from vmware_nsx/plugins/dvs.py rename to vmware_nsx/plugins/dvs/plugin.py diff --git a/vmware_nsx/vshield/__init__.py b/vmware_nsx/plugins/nsx_mh/__init__.py similarity index 100% rename from vmware_nsx/vshield/__init__.py rename to vmware_nsx/plugins/nsx_mh/__init__.py diff --git a/vmware_nsx/plugins/base.py b/vmware_nsx/plugins/nsx_mh/plugin.py similarity index 100% rename from vmware_nsx/plugins/base.py rename to vmware_nsx/plugins/nsx_mh/plugin.py diff --git a/vmware_nsx/vshield/common/__init__.py b/vmware_nsx/plugins/nsx_v/__init__.py similarity index 100% rename from vmware_nsx/vshield/common/__init__.py rename to vmware_nsx/plugins/nsx_v/__init__.py diff --git a/vmware_nsx/vshield/tasks/__init__.py b/vmware_nsx/plugins/nsx_v/drivers/__init__.py similarity index 100% rename from vmware_nsx/vshield/tasks/__init__.py rename to vmware_nsx/plugins/nsx_v/drivers/__init__.py diff --git a/vmware_nsx/plugins/nsx_v_drivers/abstract_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py similarity index 100% rename from vmware_nsx/plugins/nsx_v_drivers/abstract_router_driver.py rename to vmware_nsx/plugins/nsx_v/drivers/abstract_router_driver.py diff --git a/vmware_nsx/plugins/nsx_v_drivers/distributed_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py similarity index 98% rename from vmware_nsx/plugins/nsx_v_drivers/distributed_router_driver.py rename to vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py index fe1d7c6cd2..3a64b93549 100644 --- a/vmware_nsx/plugins/nsx_v_drivers/distributed_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py @@ -21,12 +21,12 @@ from neutron.db import l3_db from neutron.i18n import _LE 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) -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) -from vmware_nsx.vshield import edge_utils +from vmware_nsx.plugins.nsx_v.vshield import edge_utils LOG = logging.getLogger(__name__) METADATA_CIDR = '169.254.169.254/32' diff --git a/vmware_nsx/plugins/nsx_v_drivers/exclusive_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/exclusive_router_driver.py similarity index 98% rename from vmware_nsx/plugins/nsx_v_drivers/exclusive_router_driver.py rename to vmware_nsx/plugins/nsx_v/drivers/exclusive_router_driver.py index 05277a3237..f230998f5f 100644 --- a/vmware_nsx/plugins/nsx_v_drivers/exclusive_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/exclusive_router_driver.py @@ -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 locking 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) -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__) diff --git a/vmware_nsx/plugins/nsx_v_drivers/shared_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py similarity index 99% rename from vmware_nsx/plugins/nsx_v_drivers/shared_router_driver.py rename to vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py index 7f853094c4..9de5463b52 100644 --- a/vmware_nsx/plugins/nsx_v_drivers/shared_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py @@ -23,13 +23,13 @@ from vmware_nsx.common import exceptions as nsx_exc from vmware_nsx.common import locking from vmware_nsx.db import nsxv_db 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) -from vmware_nsx.plugins import nsx_v_md_proxy -from vmware_nsx.vshield.common import ( +from vmware_nsx.plugins.nsx_v import md_proxy as nsx_v_md_proxy +from vmware_nsx.plugins.nsx_v import plugin as nsx_v +from vmware_nsx.plugins.nsx_v.vshield.common import ( 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__) diff --git a/vmware_nsx/plugins/managers.py b/vmware_nsx/plugins/nsx_v/managers.py similarity index 100% rename from vmware_nsx/plugins/managers.py rename to vmware_nsx/plugins/nsx_v/managers.py diff --git a/vmware_nsx/plugins/nsx_v_md_proxy.py b/vmware_nsx/plugins/nsx_v/md_proxy.py similarity index 99% rename from vmware_nsx/plugins/nsx_v_md_proxy.py rename to vmware_nsx/plugins/nsx_v/md_proxy.py index d350e788cf..de31cd70e3 100644 --- a/vmware_nsx/plugins/nsx_v_md_proxy.py +++ b/vmware_nsx/plugins/nsx_v/md_proxy.py @@ -29,11 +29,11 @@ from vmware_nsx.common import exceptions as nsxv_exc from vmware_nsx.common import locking from vmware_nsx.common import nsxv_constants 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) -from vmware_nsx.vshield.common import ( +from vmware_nsx.plugins.nsx_v.vshield.common import ( 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_IP_ADDR = '169.254.169.254' diff --git a/vmware_nsx/plugins/nsx_v.py b/vmware_nsx/plugins/nsx_v/plugin.py similarity index 99% rename from vmware_nsx/plugins/nsx_v.py rename to vmware_nsx/plugins/nsx_v/plugin.py index 7bbb74e504..3269f9687d 100644 --- a/vmware_nsx/plugins/nsx_v.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -65,15 +65,15 @@ from vmware_nsx.extensions import ( advancedserviceproviders as as_providers) from vmware_nsx.extensions import ( vnicindex as ext_vnic_idx) -from vmware_nsx.plugins import managers -from vmware_nsx.plugins import nsx_v_md_proxy -from vmware_nsx.vshield.common import ( +from vmware_nsx.plugins.nsx_v import managers +from vmware_nsx.plugins.nsx_v import md_proxy as nsx_v_md_proxy +from vmware_nsx.plugins.nsx_v.vshield.common import ( constants as vcns_const) -from vmware_nsx.vshield.common import ( +from vmware_nsx.plugins.nsx_v.vshield.common import ( exceptions as vsh_exc) -from vmware_nsx.vshield import edge_utils -from vmware_nsx.vshield import securitygroup_utils -from vmware_nsx.vshield import vcns_driver +from vmware_nsx.plugins.nsx_v.vshield import edge_utils +from vmware_nsx.plugins.nsx_v.vshield import securitygroup_utils +from vmware_nsx.plugins.nsx_v.vshield import vcns_driver LOG = logging.getLogger(__name__) PORTGROUP_PREFIX = 'dvportgroup' diff --git a/vmware_nsx/plugins/nsx_v/vshield/__init__.py b/vmware_nsx/plugins/nsx_v/vshield/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vmware_nsx/vshield/common/VcnsApiClient.py b/vmware_nsx/plugins/nsx_v/vshield/common/VcnsApiClient.py similarity index 98% rename from vmware_nsx/vshield/common/VcnsApiClient.py rename to vmware_nsx/plugins/nsx_v/vshield/common/VcnsApiClient.py index cd01049e50..c1c5f6f66c 100644 --- a/vmware_nsx/vshield/common/VcnsApiClient.py +++ b/vmware_nsx/plugins/nsx_v/vshield/common/VcnsApiClient.py @@ -18,7 +18,7 @@ import eventlet from oslo_serialization import jsonutils import six -from vmware_nsx.vshield.common import exceptions +from vmware_nsx.plugins.nsx_v.vshield.common import exceptions httplib2 = eventlet.import_patched('httplib2') diff --git a/vmware_nsx/plugins/nsx_v/vshield/common/__init__.py b/vmware_nsx/plugins/nsx_v/vshield/common/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vmware_nsx/vshield/common/constants.py b/vmware_nsx/plugins/nsx_v/vshield/common/constants.py similarity index 100% rename from vmware_nsx/vshield/common/constants.py rename to vmware_nsx/plugins/nsx_v/vshield/common/constants.py diff --git a/vmware_nsx/vshield/common/exceptions.py b/vmware_nsx/plugins/nsx_v/vshield/common/exceptions.py similarity index 100% rename from vmware_nsx/vshield/common/exceptions.py rename to vmware_nsx/plugins/nsx_v/vshield/common/exceptions.py diff --git a/vmware_nsx/vshield/edge_appliance_driver.py b/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py similarity index 99% rename from vmware_nsx/vshield/edge_appliance_driver.py rename to vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py index 48bd1b4ee1..451a81b45c 100644 --- a/vmware_nsx/vshield/edge_appliance_driver.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py @@ -24,11 +24,11 @@ from oslo_utils import excutils from neutron.i18n import _LE, _LI, _LW from vmware_nsx.common import nsxv_constants from vmware_nsx.common import utils -from vmware_nsx.vshield.common import constants -from vmware_nsx.vshield.common import exceptions -from vmware_nsx.vshield.tasks import ( +from vmware_nsx.plugins.nsx_v.vshield.common import constants +from vmware_nsx.plugins.nsx_v.vshield.common import exceptions +from vmware_nsx.plugins.nsx_v.vshield.tasks import ( 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__) diff --git a/vmware_nsx/vshield/edge_firewall_driver.py b/vmware_nsx/plugins/nsx_v/vshield/edge_firewall_driver.py similarity index 99% rename from vmware_nsx/vshield/edge_firewall_driver.py rename to vmware_nsx/plugins/nsx_v/vshield/edge_firewall_driver.py index 72518fcdc6..36dca3807d 100644 --- a/vmware_nsx/vshield/edge_firewall_driver.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_firewall_driver.py @@ -18,11 +18,11 @@ from oslo_utils import excutils from neutron.i18n import _, _LE 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) -from vmware_nsx.vshield.tasks import ( +from vmware_nsx.plugins.nsx_v.vshield.tasks import ( 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__) diff --git a/vmware_nsx/vshield/edge_ipsecvpn_driver.py b/vmware_nsx/plugins/nsx_v/vshield/edge_ipsecvpn_driver.py similarity index 99% rename from vmware_nsx/vshield/edge_ipsecvpn_driver.py rename to vmware_nsx/plugins/nsx_v/vshield/edge_ipsecvpn_driver.py index 61cd5c0121..61a5919118 100644 --- a/vmware_nsx/vshield/edge_ipsecvpn_driver.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_ipsecvpn_driver.py @@ -16,7 +16,7 @@ from oslo_log import log as logging from oslo_utils import excutils 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) LOG = logging.getLogger(__name__) diff --git a/vmware_nsx/vshield/edge_loadbalancer_driver.py b/vmware_nsx/plugins/nsx_v/vshield/edge_loadbalancer_driver.py similarity index 99% rename from vmware_nsx/vshield/edge_loadbalancer_driver.py rename to vmware_nsx/plugins/nsx_v/vshield/edge_loadbalancer_driver.py index b72a007b0c..155f00a64f 100644 --- a/vmware_nsx/vshield/edge_loadbalancer_driver.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_loadbalancer_driver.py @@ -25,9 +25,9 @@ from neutron import manager from neutron.plugins.common import constants from vmware_nsx.common import locking 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) -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__) diff --git a/vmware_nsx/vshield/edge_utils.py b/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py similarity index 99% rename from vmware_nsx/vshield/edge_utils.py rename to vmware_nsx/plugins/nsx_v/vshield/edge_utils.py index a99212c9fd..78550f2685 100644 --- a/vmware_nsx/vshield/edge_utils.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py @@ -37,12 +37,12 @@ from vmware_nsx.common import locking from vmware_nsx.common import nsxv_constants from vmware_nsx.db import db as nsx_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) -from vmware_nsx.vshield.tasks import ( +from vmware_nsx.plugins.nsx_v.vshield.tasks import ( constants as task_const) -from vmware_nsx.vshield.tasks import tasks -from vmware_nsx.vshield import vcns +from vmware_nsx.plugins.nsx_v.vshield.tasks import tasks +from vmware_nsx.plugins.nsx_v.vshield import vcns WORKER_POOL_SIZE = 8 RP_FILTER_PROPERTY_OFF_TEMPLATE = 'sysctl.net.ipv4.conf.%s.rp_filter=%s' diff --git a/vmware_nsx/vshield/nsxv_edge_cfg_obj.py b/vmware_nsx/plugins/nsx_v/vshield/nsxv_edge_cfg_obj.py similarity index 97% rename from vmware_nsx/vshield/nsxv_edge_cfg_obj.py rename to vmware_nsx/plugins/nsx_v/vshield/nsxv_edge_cfg_obj.py index 7b4e1d8ed0..0ef56fa773 100644 --- a/vmware_nsx/vshield/nsxv_edge_cfg_obj.py +++ b/vmware_nsx/plugins/nsx_v/vshield/nsxv_edge_cfg_obj.py @@ -18,7 +18,7 @@ import abc from oslo_serialization import jsonutils import six -from vmware_nsx.vshield import vcns +from vmware_nsx.plugins.nsx_v.vshield import vcns @six.add_metaclass(abc.ABCMeta) diff --git a/vmware_nsx/vshield/nsxv_loadbalancer.py b/vmware_nsx/plugins/nsx_v/vshield/nsxv_loadbalancer.py similarity index 99% rename from vmware_nsx/vshield/nsxv_loadbalancer.py rename to vmware_nsx/plugins/nsx_v/vshield/nsxv_loadbalancer.py index c4ec9720e3..62b7075133 100644 --- a/vmware_nsx/vshield/nsxv_loadbalancer.py +++ b/vmware_nsx/plugins/nsx_v/vshield/nsxv_loadbalancer.py @@ -16,7 +16,7 @@ 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__) diff --git a/vmware_nsx/vshield/securitygroup_utils.py b/vmware_nsx/plugins/nsx_v/vshield/securitygroup_utils.py similarity index 100% rename from vmware_nsx/vshield/securitygroup_utils.py rename to vmware_nsx/plugins/nsx_v/vshield/securitygroup_utils.py diff --git a/vmware_nsx/plugins/nsx_v/vshield/tasks/__init__.py b/vmware_nsx/plugins/nsx_v/vshield/tasks/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vmware_nsx/vshield/tasks/constants.py b/vmware_nsx/plugins/nsx_v/vshield/tasks/constants.py similarity index 100% rename from vmware_nsx/vshield/tasks/constants.py rename to vmware_nsx/plugins/nsx_v/vshield/tasks/constants.py diff --git a/vmware_nsx/vshield/tasks/tasks.py b/vmware_nsx/plugins/nsx_v/vshield/tasks/tasks.py similarity index 99% rename from vmware_nsx/vshield/tasks/tasks.py rename to vmware_nsx/plugins/nsx_v/vshield/tasks/tasks.py index 86974c075a..f9a77dbd29 100644 --- a/vmware_nsx/vshield/tasks/tasks.py +++ b/vmware_nsx/plugins/nsx_v/vshield/tasks/tasks.py @@ -24,7 +24,7 @@ from oslo_service import loopingcall import six 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 diff --git a/vmware_nsx/vshield/vcns.py b/vmware_nsx/plugins/nsx_v/vshield/vcns.py similarity index 99% rename from vmware_nsx/vshield/vcns.py rename to vmware_nsx/plugins/nsx_v/vshield/vcns.py index cbef80ae3f..fa196031dc 100644 --- a/vmware_nsx/vshield/vcns.py +++ b/vmware_nsx/plugins/nsx_v/vshield/vcns.py @@ -20,8 +20,8 @@ from oslo_serialization import jsonutils import retrying import xml.etree.ElementTree as et -from vmware_nsx.vshield.common import exceptions -from vmware_nsx.vshield.common import VcnsApiClient +from vmware_nsx.plugins.nsx_v.vshield.common import exceptions +from vmware_nsx.plugins.nsx_v.vshield.common import VcnsApiClient LOG = logging.getLogger(__name__) diff --git a/vmware_nsx/vshield/vcns_driver.py b/vmware_nsx/plugins/nsx_v/vshield/vcns_driver.py similarity index 88% rename from vmware_nsx/vshield/vcns_driver.py rename to vmware_nsx/plugins/nsx_v/vshield/vcns_driver.py index 15521ebadf..869c6f9cda 100644 --- a/vmware_nsx/vshield/vcns_driver.py +++ b/vmware_nsx/plugins/nsx_v/vshield/vcns_driver.py @@ -20,11 +20,11 @@ from oslo_config import cfg from oslo_log import log as logging from vmware_nsx.common import config # noqa -from vmware_nsx.vshield import edge_appliance_driver -from vmware_nsx.vshield import edge_firewall_driver -from vmware_nsx.vshield import edge_loadbalancer_driver -from vmware_nsx.vshield.tasks import tasks -from vmware_nsx.vshield import vcns +from vmware_nsx.plugins.nsx_v.vshield import edge_appliance_driver +from vmware_nsx.plugins.nsx_v.vshield import edge_firewall_driver +from vmware_nsx.plugins.nsx_v.vshield import edge_loadbalancer_driver +from vmware_nsx.plugins.nsx_v.vshield.tasks import tasks +from vmware_nsx.plugins.nsx_v.vshield import vcns LOG = logging.getLogger(__name__) diff --git a/vmware_nsx/plugins/nsx_v3/__init__.py b/vmware_nsx/plugins/nsx_v3/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vmware_nsx/plugins/nsx_v3_plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py similarity index 100% rename from vmware_nsx/plugins/nsx_v3_plugin.py rename to vmware_nsx/plugins/nsx_v3/plugin.py diff --git a/vmware_nsx/tests/unit/vmware/__init__.py b/vmware_nsx/tests/unit/vmware/__init__.py index b483625dad..cd4e83d217 100644 --- a/vmware_nsx/tests/unit/vmware/__init__.py +++ b/vmware_nsx/tests/unit/vmware/__init__.py @@ -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 import extensions 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) -from vmware_nsx.vshield import edge_utils -from vmware_nsx.vshield import vcns -import vmware_nsx.vshield.vcns_driver as vcnsdriver +from vmware_nsx.plugins.nsx_v.vshield import edge_utils +from vmware_nsx.plugins.nsx_v.vshield import vcns +import vmware_nsx.plugins.nsx_v.vshield.vcns_driver as vcnsdriver plugin = neutron_plugin.NsxPlugin diff --git a/vmware_nsx/tests/unit/vmware/nsx_v/test_edge_loadbalancer_driver.py b/vmware_nsx/tests/unit/vmware/nsx_v/test_edge_loadbalancer_driver.py index 201f4b9711..d268c483f5 100644 --- a/vmware_nsx/tests/unit/vmware/nsx_v/test_edge_loadbalancer_driver.py +++ b/vmware_nsx/tests/unit/vmware/nsx_v/test_edge_loadbalancer_driver.py @@ -18,7 +18,7 @@ import mock from neutron import context 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.' 'loadbalancer.drivers.vmware.edge_driver.' diff --git a/vmware_nsx/tests/unit/vmware/nsx_v/test_nsxv_loadbalancer.py b/vmware_nsx/tests/unit/vmware/nsx_v/test_nsxv_loadbalancer.py index 7ca0746c26..83394dc51e 100644 --- a/vmware_nsx/tests/unit/vmware/nsx_v/test_nsxv_loadbalancer.py +++ b/vmware_nsx/tests/unit/vmware/nsx_v/test_nsxv_loadbalancer.py @@ -17,8 +17,8 @@ import mock from oslo_serialization import jsonutils from neutron.tests import base -from vmware_nsx.vshield import nsxv_loadbalancer -from vmware_nsx.vshield import vcns +from vmware_nsx.plugins.nsx_v.vshield import nsxv_loadbalancer +from vmware_nsx.plugins.nsx_v.vshield import vcns class NsxvLoadbalancerTestCase(base.BaseTestCase): diff --git a/vmware_nsx/tests/unit/vmware/test_nsx_misc.py b/vmware_nsx/tests/unit/vmware/test_nsx_misc.py index c23a11bbee..b0cecefffc 100644 --- a/vmware_nsx/tests/unit/vmware/test_nsx_misc.py +++ b/vmware_nsx/tests/unit/vmware/test_nsx_misc.py @@ -15,8 +15,8 @@ from neutron.tests import base -from vmware_nsx.vshield.common import exceptions -from vmware_nsx.vshield import vcns +from vmware_nsx.plugins.nsx_v.vshield.common import exceptions +from vmware_nsx.plugins.nsx_v.vshield import vcns def raise_until_attempt(attempt, exception): diff --git a/vmware_nsx/tests/unit/vmware/test_nsx_v3_plugin.py b/vmware_nsx/tests/unit/vmware/test_nsx_v3_plugin.py index badae2160f..a52b6caad1 100644 --- a/vmware_nsx/tests/unit/vmware/test_nsx_v3_plugin.py +++ b/vmware_nsx/tests/unit/vmware/test_nsx_v3_plugin.py @@ -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.vmware import nsx_v3_mocks -PLUGIN_NAME = ('vmware_nsx.' - 'plugins.nsx_v3_plugin.NsxV3Plugin') +PLUGIN_NAME = ('vmware_nsx.plugin.NsxV3Plugin') class NsxPluginV3TestCase(test_plugin.NeutronDbPluginV2TestCase): diff --git a/vmware_nsx/tests/unit/vmware/test_nsx_v_plugin.py b/vmware_nsx/tests/unit/vmware/test_nsx_v_plugin.py index fffea87070..afe36adaab 100644 --- a/vmware_nsx/tests/unit/vmware/test_nsx_v_plugin.py +++ b/vmware_nsx/tests/unit/vmware/test_nsx_v_plugin.py @@ -51,13 +51,13 @@ from vmware_nsx.extensions import ( routertype as router_type) from vmware_nsx.extensions import ( 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.vmware.extensions import test_vnic_index from vmware_nsx.tests.unit.vmware import test_utils 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' diff --git a/vmware_nsx/tests/unit/vmware/vshield/fake_vcns.py b/vmware_nsx/tests/unit/vmware/vshield/fake_vcns.py index 1f5ff13fe3..880ef6fbac 100644 --- a/vmware_nsx/tests/unit/vmware/vshield/fake_vcns.py +++ b/vmware_nsx/tests/unit/vmware/vshield/fake_vcns.py @@ -19,7 +19,7 @@ from oslo_utils import uuidutils import six 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' diff --git a/vmware_nsx/tests/unit/vmware/vshield/test_edge_utils.py b/vmware_nsx/tests/unit/vmware/vshield/test_edge_utils.py index 1d656bcf4d..fb4e752796 100644 --- a/vmware_nsx/tests/unit/vmware/vshield/test_edge_utils.py +++ b/vmware_nsx/tests/unit/vmware/vshield/test_edge_utils.py @@ -24,10 +24,10 @@ from neutron.plugins.common import constants as plugin_const from neutron.tests.unit import testlib_api from vmware_nsx.common import nsxv_constants from vmware_nsx.db import nsxv_db -from vmware_nsx.tests.unit import vmware -from vmware_nsx.vshield.common import ( +from vmware_nsx.plugins.nsx_v.vshield.common import ( 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 diff --git a/vmware_nsx/tests/unit/vmware/vshield/test_vcns_driver.py b/vmware_nsx/tests/unit/vmware/vshield/test_vcns_driver.py index a159b18b4e..2770762e92 100644 --- a/vmware_nsx/tests/unit/vmware/vshield/test_vcns_driver.py +++ b/vmware_nsx/tests/unit/vmware/vshield/test_vcns_driver.py @@ -19,14 +19,14 @@ import mock from neutron.tests import base 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.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")