use service type constants from neutron_lib plugins
The well known service type constants are in neutron_lib.plugins.constants, but for legacy reasons a few still exist and are referenced from neutron_lib.constants that we'd like to remove. This patch switches references over to neutron_lib's plugin constants. Change-Id: I2d51059780cb8e4acfe1e4c1fa8082de80fed2d9
This commit is contained in:
parent
08adaa1a9f
commit
481290f8fd
|
@ -2861,7 +2861,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
|||
# Will raise FlavorNotFound if doesn't exist
|
||||
fl_db = flavors_plugin.FlavorsPlugin.get_flavor(
|
||||
flv_plugin, context, flavor_id)
|
||||
if fl_db['service_type'] != constants.L3:
|
||||
if fl_db['service_type'] != plugin_const.L3:
|
||||
raise flavors.InvalidFlavorServiceType(
|
||||
service_type=fl_db['service_type'])
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import constants as lib_const
|
||||
from neutron_lib.plugins import constants as plugin_const
|
||||
from neutron_lib.plugins import directory
|
||||
|
||||
|
@ -42,7 +41,7 @@ class LoadbalancerBaseManager(object):
|
|||
def core_plugin(self):
|
||||
if not LoadbalancerBaseManager._core_plugin:
|
||||
LoadbalancerBaseManager._core_plugin = (
|
||||
self._get_plugin(lib_const.CORE))
|
||||
self._get_plugin(plugin_const.CORE))
|
||||
|
||||
return LoadbalancerBaseManager._core_plugin
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ from neutron.extensions import allowedaddresspairs
|
|||
from neutron_lib.callbacks import registry
|
||||
from neutron_lib import constants as const
|
||||
from neutron_lib import context as neutron_context
|
||||
from neutron_lib.plugins import constants as plugin_constants
|
||||
from neutron_lib.plugins import directory
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -50,11 +51,11 @@ class PortsPlugin(db_base_plugin_v2.NeutronDbPluginV2,
|
|||
portsecurity_db.PortSecurityDbMixin,
|
||||
addr_pair_db.AllowedAddressPairsMixin):
|
||||
def __enter__(self):
|
||||
directory.add_plugin(const.CORE, self)
|
||||
directory.add_plugin(plugin_constants.CORE, self)
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
directory.add_plugin(const.CORE, None)
|
||||
directory.add_plugin(plugin_constants.CORE, None)
|
||||
|
||||
|
||||
def get_port_nsx_id(session, neutron_id):
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
|
||||
from neutron.db import db_base_plugin_v2
|
||||
from neutron_lib import constants as const
|
||||
from neutron_lib import context
|
||||
from neutron_lib.plugins import constants as const
|
||||
from neutron_lib.plugins import directory
|
||||
|
||||
from vmware_nsx.db import db as nsx_db
|
||||
|
|
|
@ -28,8 +28,8 @@ from neutron.tests import base
|
|||
from neutron.tests.unit.api import test_extensions
|
||||
from neutron.tests.unit.api.v2 import test_base
|
||||
from neutron.tests.unit.db import test_db_base_plugin_v2 as test_db_plugin
|
||||
from neutron_lib import constants
|
||||
from neutron_lib import context
|
||||
from neutron_lib.plugins import constants
|
||||
from neutron_lib.plugins import directory
|
||||
|
||||
from vmware_nsx.api_client import exception as api_exc
|
||||
|
|
|
@ -5224,7 +5224,7 @@ class TestRouterFlavorTestCase(extension.ExtensionTestCase,
|
|||
if create_az is not None:
|
||||
router_data['availability_zone_hints'] = [create_az]
|
||||
|
||||
flavor_data = {'service_type': constants.L3,
|
||||
flavor_data = {'service_type': plugin_const.L3,
|
||||
'enabled': True,
|
||||
'service_profiles': ['profile_id']}
|
||||
|
||||
|
@ -5380,7 +5380,7 @@ class TestRouterFlavorTestCase(extension.ExtensionTestCase,
|
|||
if create_az is not None:
|
||||
router_data['availability_zone_hints'] = [create_az]
|
||||
|
||||
flavor_data = {'service_type': constants.L3,
|
||||
flavor_data = {'service_type': plugin_const.L3,
|
||||
'enabled': True,
|
||||
'service_profiles': ['profile_id']}
|
||||
|
||||
|
|
Loading…
Reference in New Issue