From 06bf8d1186fcbcac63086eea07483ff71b2757f9 Mon Sep 17 00:00:00 2001 From: Boden R Date: Fri, 22 Sep 2017 15:55:08 -0600 Subject: [PATCH] use common constants from lib neutron-lib contains the neutron.common.constants. This patch switches references over to use the lib version of them. Change-Id: I0354c84bd85e20ff4ea7ba392bf9ebfc2e7ac70e --- vmware_nsx/services/qos/nsx_v/driver.py | 13 +++++++------ vmware_nsx/services/qos/nsx_v/utils.py | 2 +- vmware_nsx/services/qos/nsx_v3/driver.py | 14 +++++++------- vmware_nsx/services/qos/nsx_v3/utils.py | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/vmware_nsx/services/qos/nsx_v/driver.py b/vmware_nsx/services/qos/nsx_v/driver.py index 7597c31293..884a91a902 100644 --- a/vmware_nsx/services/qos/nsx_v/driver.py +++ b/vmware_nsx/services/qos/nsx_v/driver.py @@ -14,26 +14,27 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib import constants +from neutron_lib.db import constants as db_constants 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.common import constants as n_consts LOG = logging.getLogger(__name__) DRIVER = None SUPPORTED_RULES = { qos_consts.RULE_TYPE_BANDWIDTH_LIMIT: { qos_consts.MAX_KBPS: { - 'type:range': [0, n_consts.DB_INTEGER_MAX_VALUE]}, + 'type:range': [0, db_constants.DB_INTEGER_MAX_VALUE]}, qos_consts.MAX_BURST: { - 'type:range': [0, n_consts.DB_INTEGER_MAX_VALUE]}, + 'type:range': [0, db_constants.DB_INTEGER_MAX_VALUE]}, qos_consts.DIRECTION: { - 'type:values': [n_consts.EGRESS_DIRECTION, - n_consts.INGRESS_DIRECTION]} + 'type:values': [constants.EGRESS_DIRECTION, + constants.INGRESS_DIRECTION]} }, qos_consts.RULE_TYPE_DSCP_MARKING: { - qos_consts.DSCP_MARK: {'type:values': n_consts.VALID_DSCP_MARKS} + qos_consts.DSCP_MARK: {'type:values': constants.VALID_DSCP_MARKS} } } diff --git a/vmware_nsx/services/qos/nsx_v/utils.py b/vmware_nsx/services/qos/nsx_v/utils.py index 8544710f37..48852f80f4 100644 --- a/vmware_nsx/services/qos/nsx_v/utils.py +++ b/vmware_nsx/services/qos/nsx_v/utils.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.common import constants as n_consts +from neutron_lib import constants as n_consts from neutron_lib.plugins import constants as plugin_const from neutron_lib.plugins import directory from neutron_lib.services.qos import constants as qos_consts diff --git a/vmware_nsx/services/qos/nsx_v3/driver.py b/vmware_nsx/services/qos/nsx_v3/driver.py index 1d6726121c..103c7071a3 100644 --- a/vmware_nsx/services/qos/nsx_v3/driver.py +++ b/vmware_nsx/services/qos/nsx_v3/driver.py @@ -14,12 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib import constants +from neutron_lib.db import constants as db_constants 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.common import constants as n_consts - from vmware_nsx.services.qos.nsx_v3 import utils as qos_utils LOG = logging.getLogger(__name__) @@ -29,15 +29,15 @@ DRIVER = None SUPPORTED_RULES = { qos_consts.RULE_TYPE_BANDWIDTH_LIMIT: { qos_consts.MAX_KBPS: { - 'type:range': [0, n_consts.DB_INTEGER_MAX_VALUE]}, + 'type:range': [0, db_constants.DB_INTEGER_MAX_VALUE]}, qos_consts.MAX_BURST: { - 'type:range': [0, n_consts.DB_INTEGER_MAX_VALUE]}, + 'type:range': [0, db_constants.DB_INTEGER_MAX_VALUE]}, qos_consts.DIRECTION: { - 'type:values': [n_consts.EGRESS_DIRECTION, - n_consts.INGRESS_DIRECTION]} + 'type:values': [constants.EGRESS_DIRECTION, + constants.INGRESS_DIRECTION]} }, qos_consts.RULE_TYPE_DSCP_MARKING: { - qos_consts.DSCP_MARK: {'type:values': n_consts.VALID_DSCP_MARKS} + qos_consts.DSCP_MARK: {'type:values': constants.VALID_DSCP_MARKS} } } diff --git a/vmware_nsx/services/qos/nsx_v3/utils.py b/vmware_nsx/services/qos/nsx_v3/utils.py index 6e3739856a..97426d2c74 100644 --- a/vmware_nsx/services/qos/nsx_v3/utils.py +++ b/vmware_nsx/services/qos/nsx_v3/utils.py @@ -17,8 +17,8 @@ from oslo_config import cfg from oslo_log import log as logging -from neutron.common import constants as n_consts from neutron_lib.api import validators +from neutron_lib import constants as n_consts from neutron_lib import exceptions as n_exc from neutron_lib.plugins import directory from neutron_lib.services.qos import constants as qos_consts