use qos constants from neutron-lib
neutron-lib contains the QoS constants. This patch removes them from neutron and replaces all such uses to lib's QoS constants. NeutronLibImpact Change-Id: I6ed379b178a2b79fd14385a1d1e87d87eb04bfb9
This commit is contained in:
parent
c0e723790f
commit
1b8664f8e1
@ -17,6 +17,7 @@ import abc
|
||||
import collections
|
||||
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
@ -27,7 +28,6 @@ from neutron.api.rpc.callbacks import events
|
||||
from neutron.api.rpc.callbacks import resources
|
||||
from neutron.api.rpc.handlers import resources_rpc
|
||||
from neutron import manager
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -16,10 +16,10 @@
|
||||
import re
|
||||
|
||||
from neutron_lib import exceptions
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
|
||||
INGRESS_QDISC_ID = "ffff:"
|
||||
|
@ -15,12 +15,12 @@
|
||||
|
||||
from neutron_lib.plugins import constants as plugin_constants
|
||||
from neutron_lib.plugins import directory
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.core_extensions import base
|
||||
from neutron.db import api as db_api
|
||||
from neutron.objects.qos import policy as policy_object
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
|
||||
class QosCoreResourceExtension(base.CoreResourceExtension):
|
||||
|
@ -24,13 +24,13 @@ from neutron_lib.db import constants as db_const
|
||||
from neutron_lib.plugins import constants
|
||||
from neutron_lib.plugins import directory
|
||||
from neutron_lib.services import base as service_base
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
import six
|
||||
|
||||
from neutron.api import extensions
|
||||
from neutron.api.v2 import base
|
||||
from neutron.api.v2 import resource_helper
|
||||
from neutron.objects.qos import rule as rule_object
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
|
||||
ALIAS = "qos"
|
||||
|
@ -13,9 +13,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
|
||||
def check_bandwidth_rule_conflict(policy, rule_data):
|
||||
|
@ -17,6 +17,7 @@ import abc
|
||||
import sys
|
||||
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from neutron_lib.utils import helpers
|
||||
from oslo_utils import versionutils
|
||||
from oslo_versionedobjects import base as obj_base
|
||||
@ -28,7 +29,6 @@ from neutron.db import api as db_api
|
||||
from neutron.db.qos import models as qos_db_model
|
||||
from neutron.objects import base
|
||||
from neutron.objects import common_types
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
DSCP_MARK = 'dscp_mark'
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
from neutron_lib.plugins import constants
|
||||
from neutron_lib.plugins import directory
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import versionutils
|
||||
from oslo_versionedobjects import base as obj_base
|
||||
@ -19,7 +20,6 @@ from oslo_versionedobjects import fields as obj_fields
|
||||
|
||||
from neutron.objects import base
|
||||
from neutron.objects import common_types
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -15,12 +15,12 @@
|
||||
import collections
|
||||
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.agent.l2.extensions import qos_linux as qos
|
||||
from neutron.services.qos.drivers.openvswitch import driver
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -31,6 +31,7 @@ from neutron_lib.exceptions import port_security as psec_exc
|
||||
from neutron_lib.plugins import constants as plugin_constants
|
||||
from neutron_lib.plugins import directory
|
||||
from neutron_lib.plugins.ml2 import api
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_config import cfg
|
||||
from oslo_db import exception as os_db_exception
|
||||
from oslo_log import helpers as log_helpers
|
||||
@ -89,7 +90,6 @@ from neutron.plugins.ml2 import models
|
||||
from neutron.plugins.ml2 import ovo_rpc
|
||||
from neutron.plugins.ml2 import rpc
|
||||
from neutron.quota import resource_registry
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.services.segments import plugin as segments_plugin
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
@ -19,6 +19,7 @@ from neutron_lib.callbacks import resources
|
||||
from neutron_lib import constants as n_const
|
||||
from neutron_lib.plugins import directory
|
||||
from neutron_lib.plugins.ml2 import api
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_log import log
|
||||
import oslo_messaging
|
||||
from sqlalchemy.orm import exc
|
||||
@ -31,7 +32,6 @@ from neutron.db import l3_hamode_db
|
||||
from neutron.db import provisioning_blocks
|
||||
from neutron.plugins.ml2 import db as ml2_db
|
||||
from neutron.plugins.ml2.drivers import type_tunnel
|
||||
from neutron.services.qos import qos_consts
|
||||
# REVISIT(kmestery): Allow the type and mechanism drivers to supply the
|
||||
# mixins and eventually remove the direct dependencies on type_tunnel.
|
||||
|
||||
|
@ -17,9 +17,9 @@ from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.db import constants as db_consts
|
||||
from neutron_lib.services.qos import base
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib.callbacks import events
|
||||
from neutron_lib.callbacks import registry
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.api.rpc.callbacks import events as rpc_events
|
||||
@ -22,7 +23,6 @@ from neutron.api.rpc.handlers import resources_rpc
|
||||
from neutron.common import constants
|
||||
from neutron.common import exceptions
|
||||
from neutron.objects.qos import policy as policy_object
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -17,9 +17,9 @@ from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.db import constants as db_consts
|
||||
from neutron_lib.services.qos import base
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -17,9 +17,9 @@ from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.db import constants as db_consts
|
||||
from neutron_lib.services.qos import base
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
# Copyright (c) 2015 Red Hat 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.
|
||||
|
||||
RULE_TYPE_BANDWIDTH_LIMIT = 'bandwidth_limit'
|
||||
RULE_TYPE_DSCP_MARKING = 'dscp_marking'
|
||||
RULE_TYPE_MINIMUM_BANDWIDTH = 'minimum_bandwidth'
|
||||
VALID_RULE_TYPES = [RULE_TYPE_BANDWIDTH_LIMIT,
|
||||
RULE_TYPE_DSCP_MARKING,
|
||||
RULE_TYPE_MINIMUM_BANDWIDTH,
|
||||
]
|
||||
|
||||
# Names of rules' attributes
|
||||
MAX_KBPS = "max_kbps"
|
||||
MAX_BURST = "max_burst_kbps"
|
||||
MIN_KBPS = "min_kbps"
|
||||
DIRECTION = "direction"
|
||||
DSCP_MARK = "dscp_mark"
|
||||
|
||||
QOS_POLICY_ID = 'qos_policy_id'
|
||||
|
||||
QOS_PLUGIN = 'qos_plugin'
|
||||
|
||||
# NOTE(slaweq): Value used to calculate burst value for egress bandwidth limit
|
||||
# if burst is not given by user. In such case burst value will be calculated
|
||||
# as 80% of bw_limit to ensure that at least limits for TCP traffic will work
|
||||
# fine.
|
||||
DEFAULT_BURST_RATE = 0.8
|
||||
|
||||
# Method names for QoSDriver
|
||||
PRECOMMIT_POSTFIX = '_precommit'
|
||||
CREATE_POLICY = 'create_policy'
|
||||
CREATE_POLICY_PRECOMMIT = CREATE_POLICY + PRECOMMIT_POSTFIX
|
||||
UPDATE_POLICY = 'update_policy'
|
||||
UPDATE_POLICY_PRECOMMIT = UPDATE_POLICY + PRECOMMIT_POSTFIX
|
||||
DELETE_POLICY = 'delete_policy'
|
||||
DELETE_POLICY_PRECOMMIT = DELETE_POLICY + PRECOMMIT_POSTFIX
|
||||
|
||||
QOS_CALL_METHODS = (
|
||||
CREATE_POLICY,
|
||||
CREATE_POLICY_PRECOMMIT,
|
||||
UPDATE_POLICY,
|
||||
UPDATE_POLICY_PRECOMMIT,
|
||||
DELETE_POLICY,
|
||||
DELETE_POLICY_PRECOMMIT, )
|
@ -17,6 +17,7 @@ from neutron_lib.callbacks import events as callbacks_events
|
||||
from neutron_lib.callbacks import registry as callbacks_registry
|
||||
from neutron_lib.callbacks import resources as callbacks_resources
|
||||
from neutron_lib import exceptions as lib_exc
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.db import api as db_api
|
||||
@ -29,7 +30,6 @@ from neutron.objects.qos import policy as policy_object
|
||||
from neutron.objects.qos import qos_policy_validator as checker
|
||||
from neutron.objects.qos import rule_type as rule_type_object
|
||||
from neutron.services.qos.drivers import manager
|
||||
from neutron.services.qos import qos_consts
|
||||
|
||||
|
||||
class QoSPlugin(qos.QoSPluginBase):
|
||||
|
@ -15,13 +15,13 @@
|
||||
import functools
|
||||
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from neutronclient.common import exceptions
|
||||
from oslo_utils import uuidutils
|
||||
import testscenarios
|
||||
|
||||
from neutron.agent.linux import tc_lib
|
||||
from neutron.common import utils
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests.common.agents import l2_extensions
|
||||
from neutron.tests.fullstack import base
|
||||
from neutron.tests.fullstack.resources import environment
|
||||
|
@ -12,6 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from tempest.common import utils
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
@ -20,7 +21,6 @@ from tempest.lib import exceptions
|
||||
import testscenarios
|
||||
import testtools
|
||||
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests.tempest.api import base
|
||||
|
||||
|
||||
|
@ -16,13 +16,13 @@ import errno
|
||||
import socket
|
||||
import time
|
||||
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_log import log as logging
|
||||
from tempest.common import utils as tutils
|
||||
from tempest.lib import decorators
|
||||
from tempest.lib import exceptions
|
||||
|
||||
from neutron.common import utils
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests.tempest.api import base as base_api
|
||||
from neutron.tests.tempest.common import ssh
|
||||
from neutron.tests.tempest import config
|
||||
|
@ -17,6 +17,7 @@ import mock
|
||||
from neutron_lib import constants as common_constants
|
||||
from neutron_lib import context
|
||||
from neutron_lib.db import constants as db_consts
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from neutron.agent.l2.extensions import qos
|
||||
@ -33,7 +34,6 @@ from neutron.plugins.ml2.drivers.openvswitch.agent import (
|
||||
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
|
||||
from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.ovs_ofctl import (
|
||||
ovs_bridge)
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests import base
|
||||
|
||||
BASE_TEST_POLICY = {'context': None,
|
||||
|
@ -14,9 +14,9 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
|
||||
from neutron.agent.linux import tc_lib
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests import base
|
||||
|
||||
DEVICE_NAME = "tap_device"
|
||||
|
@ -16,13 +16,13 @@
|
||||
import mock
|
||||
from neutron_lib import context
|
||||
from neutron_lib.plugins import constants as plugin_constants
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.core_extensions import base as base_core
|
||||
from neutron.core_extensions import qos as qos_core
|
||||
from neutron.objects.qos import policy
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests import base
|
||||
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
import mock
|
||||
from neutron_lib import constants as n_const
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_utils import uuidutils
|
||||
from oslo_versionedobjects import exception
|
||||
import testtools
|
||||
@ -22,7 +23,6 @@ from neutron.objects.db import api as db_api
|
||||
from neutron.objects import network as net_obj
|
||||
from neutron.objects.qos import policy
|
||||
from neutron.objects.qos import rule
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests.unit.objects import test_base
|
||||
from neutron.tests.unit import testlib_api
|
||||
|
||||
|
@ -11,13 +11,13 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
from oslo_versionedobjects import exception
|
||||
|
||||
from neutron.objects.qos import policy
|
||||
from neutron.objects.qos import rule
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests import base as neutron_test_base
|
||||
from neutron.tests.unit.objects import test_base
|
||||
from neutron.tests.unit import testlib_api
|
||||
|
@ -16,12 +16,12 @@
|
||||
import mock
|
||||
from neutron_lib import constants as lib_consts
|
||||
from neutron_lib.db import constants as db_consts
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_config import cfg
|
||||
|
||||
from neutron.common import constants
|
||||
from neutron import manager
|
||||
from neutron.objects.qos import rule_type
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.services.qos import qos_plugin
|
||||
from neutron.tests import base as test_base
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
import mock
|
||||
from neutron_lib import constants
|
||||
from neutron_lib import context
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from neutron.objects.qos import policy
|
||||
@ -23,7 +24,6 @@ from neutron.objects.qos import rule
|
||||
from neutron.plugins.ml2.drivers.mech_sriov.agent.common import exceptions
|
||||
from neutron.plugins.ml2.drivers.mech_sriov.agent.extension_drivers import (
|
||||
qos_driver)
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests import base
|
||||
|
||||
|
||||
|
@ -24,6 +24,7 @@ from neutron_lib.callbacks import resources
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.plugins import constants as plugin_constants
|
||||
from neutron_lib.plugins import directory
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_config import cfg
|
||||
from oslo_context import context as oslo_context
|
||||
from sqlalchemy.orm import exc
|
||||
@ -35,7 +36,6 @@ from neutron.plugins.ml2 import db as ml2_db
|
||||
from neutron.plugins.ml2.drivers import type_tunnel
|
||||
from neutron.plugins.ml2 import managers
|
||||
from neutron.plugins.ml2 import rpc as plugin_rpc
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests import base
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib import constants as lib_consts
|
||||
from neutron_lib import context
|
||||
from neutron_lib.services.qos import base as qos_driver_base
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from neutron.common import constants
|
||||
@ -22,7 +23,6 @@ from neutron.common import exceptions
|
||||
from neutron.objects import ports as ports_object
|
||||
from neutron.objects.qos import rule as rule_object
|
||||
from neutron.services.qos.drivers import manager as driver_mgr
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.tests.unit.services.qos import base
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ from neutron_lib import context
|
||||
from neutron_lib import exceptions as lib_exc
|
||||
from neutron_lib.plugins import constants as plugins_constants
|
||||
from neutron_lib.plugins import directory
|
||||
from neutron_lib.services.qos import constants as qos_consts
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
@ -24,7 +25,6 @@ from neutron import manager
|
||||
from neutron.objects import base as base_object
|
||||
from neutron.objects.qos import policy as policy_object
|
||||
from neutron.objects.qos import rule as rule_object
|
||||
from neutron.services.qos import qos_consts
|
||||
from neutron.services.qos import qos_plugin
|
||||
from neutron.tests.unit.services.qos import base
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user