Shorten the path of the nicira nvp plugin.

* s+[/.]nicira_nvp_plugin++
 * Backwards compatibility is maintained by importing the
   nicira package as nicira_nvp_plugin in the plugins package.
 * It may be necessary to remove stale .pyc/.pyo files under the
   nicira path after applying this patch.
 * DocImpact
 * Addresses bug 1166307

Change-Id: I241a2a75106398506b01bcb7a6ddbaafa1b7bd30
This commit is contained in:
Maru Newby 2013-04-05 16:59:58 +00:00
parent 1152aad4fc
commit 4836f036c7
48 changed files with 92 additions and 95 deletions

View File

@ -23,7 +23,7 @@ import os
import sys
sys.path.insert(0, os.getcwd())
from quantum.plugins.nicira.nicira_nvp_plugin.check_nvp_config import main
from quantum.plugins.nicira.check_nvp_config import main
main(sys.argv)

View File

@ -30,7 +30,7 @@ down_revision = '1b693c095aa3'
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2'
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2'
]
from alembic import op

View File

@ -30,7 +30,7 @@ down_revision = '4692d074d587'
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2'
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2'
]
from alembic import op

View File

@ -30,7 +30,7 @@ down_revision = '3cb5d900c5de'
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2'
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2'
]
from alembic import op

View File

@ -33,7 +33,7 @@ migration_for_plugins = [
'quantum.plugins.bigswitch.plugin.QuantumRestProxyV2',
'quantum.plugins.hyperv.hyperv_quantum_plugin.HyperVQuantumPlugin',
'quantum.plugins.midonet.plugin.MidonetPluginV2',
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2'
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2'
]
from quantum.db import migration

View File

@ -30,7 +30,7 @@ down_revision = '1c33fa3cd1a1'
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPluginV2.NvpPluginV2'
'quantum.plugins.nicira.QuantumPluginV2.NvpPluginV2'
]
from alembic import op

View File

@ -30,7 +30,7 @@ down_revision = '49332180ca96'
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2'
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2'
]
from alembic import op

View File

@ -31,7 +31,7 @@ down_revision = '48b6f43f7471'
migration_for_plugins = [
'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2',
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2',
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2',
'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2',
'quantum.plugins.nec.nec_plugin.NECPluginV2',
'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2',

View File

@ -30,7 +30,7 @@ down_revision = '54c2c487e913'
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2'
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2'
]
from alembic import op

View File

@ -32,7 +32,7 @@ down_revision = '3b54bf9e29f7'
migration_for_plugins = [
'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2',
'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2',
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2',
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2',
'quantum.plugins.nec.nec_plugin.NECPluginV2',
'quantum.plugins.brocade.QuantumPlugin.BrocadePluginV2',
]

View File

@ -32,7 +32,7 @@ down_revision = '363468ac592c'
migration_for_plugins = [
'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2',
'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2',
'quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2',
'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2',
'quantum.plugins.nec.nec_plugin.NECPluginV2',
'quantum.plugins.brocade.QuantumPlugin.BrocadePluginV2',
]

View File

@ -30,7 +30,7 @@ PLUGINS = {
'lbr': 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2',
'meta': 'quantum.plugins.metaplugin.meta_quantum_plugin.MetaPluginV2',
'nec': 'quantum.plugins.nec.nec_plugin.NECPluginV2',
'nvp': 'quantum.plugins.nicira/nicira_nvp_plugin/QuantumPlugin',
'nvp': 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2',
'ovs': 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2',
'ryu': 'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2',
}

View File

@ -14,3 +14,11 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import sys
from quantum.plugins import nicira
# Provide a mapping for the nicira_nvp_plugin package to ensure
# backwards compatibilty for configuration.
sys.modules['quantum.plugins.nicira.nicira_nvp_plugin'] = nicira

View File

@ -19,7 +19,7 @@
import httplib # basic HTTP library for HTTPS connections
import logging
from quantum.plugins.nicira.nicira_nvp_plugin.api_client import (
from quantum.plugins.nicira.api_client import (
client_eventlet, request_eventlet)
LOG = logging.getLogger("NVPApiHelper")

View File

@ -51,27 +51,20 @@ from quantum.extensions import providernet as pnet
from quantum.extensions import securitygroup as ext_sg
from quantum.openstack.common import importutils
from quantum.openstack.common import rpc
from quantum.plugins.nicira.nicira_nvp_plugin.common import (metadata_access
as nvp_meta)
from quantum.plugins.nicira.nicira_nvp_plugin.common import (securitygroups
as nvp_sec)
from quantum.plugins.nicira.common import metadata_access as nvp_meta
from quantum.plugins.nicira.common import securitygroups as nvp_sec
from quantum import policy
from quantum.plugins.nicira.nicira_nvp_plugin.common import config
from quantum.plugins.nicira.nicira_nvp_plugin.common import (exceptions
as nvp_exc)
from quantum.plugins.nicira.nicira_nvp_plugin.extensions import (nvp_networkgw
as networkgw)
from quantum.plugins.nicira.nicira_nvp_plugin.extensions import (nvp_qos
as ext_qos)
from quantum.plugins.nicira.nicira_nvp_plugin import nicira_db
from quantum.plugins.nicira.nicira_nvp_plugin import (nicira_networkgw_db
as networkgw_db)
from quantum.plugins.nicira.nicira_nvp_plugin import nicira_qos_db as qos_db
from quantum.plugins.nicira.nicira_nvp_plugin import nvp_cluster
from quantum.plugins.nicira.nicira_nvp_plugin.nvp_plugin_version import (
PLUGIN_VERSION)
from quantum.plugins.nicira.nicira_nvp_plugin import NvpApiClient
from quantum.plugins.nicira.nicira_nvp_plugin import nvplib
from quantum.plugins.nicira.common import config
from quantum.plugins.nicira.common import exceptions as nvp_exc
from quantum.plugins.nicira.extensions import nvp_networkgw as networkgw
from quantum.plugins.nicira.extensions import nvp_qos as ext_qos
from quantum.plugins.nicira import nicira_db
from quantum.plugins.nicira import nicira_networkgw_db as networkgw_db
from quantum.plugins.nicira import nicira_qos_db as qos_db
from quantum.plugins.nicira import nvp_cluster
from quantum.plugins.nicira.nvp_plugin_version import PLUGIN_VERSION
from quantum.plugins.nicira import NvpApiClient
from quantum.plugins.nicira import nvplib
LOG = logging.getLogger("QuantumPlugin")
NVP_NOSNAT_RULES_ORDER = 10
@ -125,7 +118,7 @@ def parse_config():
if not cfg.CONF.api_extensions_path:
cfg.CONF.set_override(
'api_extensions_path',
'quantum/plugins/nicira/nicira_nvp_plugin/extensions')
'quantum/plugins/nicira/extensions')
if (cfg.CONF.NVP.metadata_mode == "access_network" and
not cfg.CONF.allow_overlapping_ips):
LOG.warn(_("Overlapping IPs must be enabled in order to setup "

View File

@ -44,5 +44,5 @@ Quantum Configuration
Modify your Quantum configuration for using the NVP Plugin:
core_plugin =
quantum.plugins.nicira.nicira_nvp_plugin.QuantumPlugin.NvpPluginV2
quantum.plugins.nicira.QuantumPlugin.NvpPluginV2

View File

@ -0,0 +1,16 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

View File

@ -25,7 +25,7 @@ import time
import logging
from quantum.plugins.nicira.nicira_nvp_plugin.api_client.common import (
from quantum.plugins.nicira.api_client.common import (
_conn_str)

View File

@ -22,8 +22,8 @@ import eventlet
import logging
import time
from quantum.plugins.nicira.nicira_nvp_plugin.api_client import client
from quantum.plugins.nicira.nicira_nvp_plugin.api_client import (
from quantum.plugins.nicira.api_client import client
from quantum.plugins.nicira.api_client import (
request_eventlet)
eventlet.monkey_patch()

View File

@ -26,7 +26,7 @@ import logging
import time
import urlparse
from quantum.plugins.nicira.nicira_nvp_plugin.api_client.common import (
from quantum.plugins.nicira.api_client.common import (
_conn_str)
logging.basicConfig(level=logging.INFO)

View File

@ -24,7 +24,7 @@ import json
import logging
import urllib
from quantum.plugins.nicira.nicira_nvp_plugin.api_client import request
from quantum.plugins.nicira.api_client import request
eventlet.monkey_patch()
logging.basicConfig(level=logging.INFO)

View File

@ -24,9 +24,9 @@ import sys
from oslo.config import cfg
from quantum.common import config
from quantum.plugins.nicira.nicira_nvp_plugin import NvpApiClient
from quantum.plugins.nicira.nicira_nvp_plugin import nvplib
from quantum.plugins.nicira.nicira_nvp_plugin import QuantumPlugin
from quantum.plugins.nicira import NvpApiClient
from quantum.plugins.nicira import nvplib
from quantum.plugins.nicira import QuantumPlugin
config.setup_logging(cfg.CONF)

View File

@ -27,9 +27,8 @@ from quantum.common import exceptions as q_exc
from quantum.db import l3_db
from quantum.db import models_v2
from quantum.openstack.common import log as logging
from quantum.plugins.nicira.nicira_nvp_plugin.common import (exceptions
as nvp_exc)
from quantum.plugins.nicira.nicira_nvp_plugin import NvpApiClient
from quantum.plugins.nicira.common import exceptions as nvp_exc
from quantum.plugins.nicira import NvpApiClient
LOG = logging.getLogger(__name__)

View File

@ -19,8 +19,8 @@ from sqlalchemy.orm import exc
import quantum.db.api as db
from quantum.openstack.common import log as logging
from quantum.plugins.nicira.nicira_nvp_plugin import nicira_models
from quantum.plugins.nicira.nicira_nvp_plugin import nicira_networkgw_db
from quantum.plugins.nicira import nicira_models
from quantum.plugins.nicira import nicira_networkgw_db
LOG = logging.getLogger(__name__)

View File

@ -31,7 +31,7 @@ from quantum.db import model_base
from quantum.db import models_v2
from quantum.openstack.common import log as logging
from quantum.openstack.common import uuidutils
from quantum.plugins.nicira.nicira_nvp_plugin.extensions import nvp_networkgw
from quantum.plugins.nicira.extensions import nvp_networkgw
LOG = logging.getLogger(__name__)

View File

@ -1,16 +0,0 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

View File

@ -23,9 +23,8 @@ from quantum.api.v2 import attributes as attr
from quantum.db import model_base
from quantum.db import models_v2
from quantum.openstack.common import uuidutils
from quantum.plugins.nicira.nicira_nvp_plugin.extensions import (nvp_qos
as ext_qos)
from quantum.plugins.nicira.nicira_nvp_plugin import nvplib
from quantum.plugins.nicira.extensions import nvp_qos as ext_qos
from quantum.plugins.nicira import nvplib
class QoSQueue(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):

View File

@ -30,9 +30,9 @@ import logging
# no quantum-specific logic in it
from quantum.common import constants
from quantum.common import exceptions as exception
from quantum.plugins.nicira.nicira_nvp_plugin.common import (
from quantum.plugins.nicira.common import (
exceptions as nvp_exc)
from quantum.plugins.nicira.nicira_nvp_plugin import NvpApiClient
from quantum.plugins.nicira import NvpApiClient
# HTTP METHODS CONSTANTS

View File

@ -19,7 +19,7 @@ import urlparse
from quantum.openstack.common import log as logging
from quantum.openstack.common import uuidutils
from quantum.plugins.nicira.nicira_nvp_plugin import NvpApiClient
from quantum.plugins.nicira import NvpApiClient
LOG = logging.getLogger(__name__)

View File

@ -15,7 +15,7 @@
from oslo.config import cfg
from quantum.plugins.nicira.nicira_nvp_plugin.common import config # noqa
from quantum.plugins.nicira.common import config # noqa
from quantum.tests import base

View File

@ -28,9 +28,8 @@ from quantum import context
from quantum.db import api as db_api
from quantum.db import db_base_plugin_v2
from quantum import manager
from quantum.plugins.nicira.nicira_nvp_plugin.extensions import (nvp_networkgw
as networkgw)
from quantum.plugins.nicira.nicira_nvp_plugin import nicira_networkgw_db
from quantum.plugins.nicira.extensions import nvp_networkgw as networkgw
from quantum.plugins.nicira import nicira_networkgw_db
from quantum.tests import base
from quantum.tests.unit import test_api_v2
from quantum.tests.unit import test_db_plugin

View File

@ -29,12 +29,11 @@ from quantum.extensions import l3
from quantum.extensions import providernet as pnet
from quantum.extensions import securitygroup as secgrp
from quantum import manager
import quantum.plugins.nicira.nicira_nvp_plugin as nvp_plugin
from quantum.plugins.nicira.nicira_nvp_plugin.extensions import nvp_networkgw
from quantum.plugins.nicira.nicira_nvp_plugin.extensions import (nvp_qos
as ext_qos)
from quantum.plugins.nicira.nicira_nvp_plugin import nvplib
from quantum.plugins.nicira.nicira_nvp_plugin import QuantumPlugin
import quantum.plugins.nicira as nvp_plugin
from quantum.plugins.nicira.extensions import nvp_networkgw
from quantum.plugins.nicira.extensions import nvp_qos as ext_qos
from quantum.plugins.nicira import nvplib
from quantum.plugins.nicira import QuantumPlugin
from quantum.tests.unit.nicira import fake_nvpapiclient
import quantum.tests.unit.nicira.test_networkgw as test_l2_gw
import quantum.tests.unit.test_db_plugin as test_plugin
@ -44,7 +43,7 @@ from quantum.tests.unit import test_extensions
import quantum.tests.unit.test_l3_plugin as test_l3_plugin
NICIRA_PKG_PATH = nvp_plugin.__name__
NICIRA_EXT_PATH = "../../plugins/nicira/nicira_nvp_plugin/extensions"
NICIRA_EXT_PATH = "../../plugins/nicira/extensions"
class NiciraPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase):
@ -419,7 +418,7 @@ class TestNiciraL3NatTestCase(test_l3_plugin.L3NatDBTestCase,
def test_floatingip_with_assoc_fails(self):
self._test_floatingip_with_assoc_fails(
'quantum.plugins.nicira.nicira_nvp_plugin.'
'quantum.plugins.nicira.'
'QuantumPlugin.NvpPluginV2')
def _nvp_metadata_setup(self):

View File

@ -9,7 +9,7 @@
import httplib
# Local
import quantum.plugins.nicira.nicira_nvp_plugin.api_client.common as naco
import quantum.plugins.nicira.api_client.common as naco
from quantum.tests import base

View File

@ -22,7 +22,7 @@ from eventlet.green import urllib2
from mock import Mock
from mock import patch
from quantum.plugins.nicira.nicira_nvp_plugin.api_client import (
from quantum.plugins.nicira.api_client import (
client_eventlet as nace,
request_eventlet as nare,
)
@ -212,7 +212,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase):
self.assertTrue(retval is None)
def test_redirect_params_setup_https_with_cooki(self):
with patch('quantum.plugins.nicira.nicira_nvp_plugin.api_client.'
with patch('quantum.plugins.nicira.api_client.'
'client_eventlet.NvpApiClientEventlet') as mock:
api_client = mock.return_value
self.req._api_client = api_client
@ -224,7 +224,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase):
self.assertTrue(api_client.acquire_redirect_connection.called)
def test_redirect_params_setup_htttps_and_query(self):
with patch('quantum.plugins.nicira.nicira_nvp_plugin.api_client.'
with patch('quantum.plugins.nicira.api_client.'
'client_eventlet.NvpApiClientEventlet') as mock:
api_client = mock.return_value
self.req._api_client = api_client
@ -236,7 +236,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase):
self.assertTrue(api_client.acquire_redirect_connection.called)
def test_redirect_params_setup_https_connection_no_cookie(self):
with patch('quantum.plugins.nicira.nicira_nvp_plugin.api_client.'
with patch('quantum.plugins.nicira.api_client.'
'client_eventlet.NvpApiClientEventlet') as mock:
api_client = mock.return_value
self.req._api_client = api_client
@ -248,7 +248,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase):
self.assertTrue(api_client.acquire_redirect_connection.called)
def test_redirect_params_setup_https_and_query_no_cookie(self):
with patch('quantum.plugins.nicira.nicira_nvp_plugin.api_client.'
with patch('quantum.plugins.nicira.api_client.'
'client_eventlet.NvpApiClientEventlet') as mock:
api_client = mock.return_value
self.req._api_client = api_client
@ -259,7 +259,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase):
self.assertTrue(api_client.acquire_redirect_connection.called)
def test_redirect_params_path_only_with_query(self):
with patch('quantum.plugins.nicira.nicira_nvp_plugin.api_client.'
with patch('quantum.plugins.nicira.api_client.'
'client_eventlet.NvpApiClientEventlet') as mock:
api_client = mock.return_value
api_client.wait_for_login.return_value = None

View File

@ -19,10 +19,10 @@ import mock
import os
from quantum.openstack.common import jsonutils as json
import quantum.plugins.nicira.nicira_nvp_plugin as nvp_plugin
from quantum.plugins.nicira.nicira_nvp_plugin import nvp_cluster
from quantum.plugins.nicira.nicira_nvp_plugin import NvpApiClient
from quantum.plugins.nicira.nicira_nvp_plugin import nvplib
import quantum.plugins.nicira as nvp_plugin
from quantum.plugins.nicira import nvp_cluster
from quantum.plugins.nicira import NvpApiClient
from quantum.plugins.nicira import nvplib
from quantum.tests import base
from quantum.tests.unit.nicira import fake_nvpapiclient
from quantum.tests.unit import test_api_v2

View File

@ -138,7 +138,7 @@ else:
('quantum-lbaas-agent = '
'quantum.plugins.services.agent_loadbalancer.agent:main'),
('quantum-check-nvp-config = '
'quantum.plugins.nicira.nicira_nvp_plugin.check_nvp_config:main'),
'quantum.plugins.nicira.check_nvp_config:main'),
]
ProjectScripts = [