Remove using PROTO_NAME_IPV6_ICMP_LEGACY from neutron.common.constants

Since neutron_lib 0.2.0 contains PROTO_NAME_IPV6_ICMP_LEGACY, remove
it from neutron.common.constants

Change-Id: Idd150ce1cbe660fc9529e5d46678f37142490a28
Closes-bug: #1585047
This commit is contained in:
Hong Hui Xiao 2016-05-24 04:43:37 +00:00
parent 067a5c2a47
commit 85863c9633
5 changed files with 7 additions and 21 deletions

View File

@ -58,14 +58,8 @@ ETHERTYPE_ARP = 0x0806
ETHERTYPE_IP = 0x0800
ETHERTYPE_IPV6 = 0x86DD
# TODO(amotoki): It should be moved to neutron-lib.
# For backward-compatibility of security group rule API,
# we keep the old value for IPv6 ICMP.
# It should be clean up in the future.
PROTO_NAME_IPV6_ICMP_LEGACY = 'icmpv6'
IP_PROTOCOL_NAME_ALIASES = {
PROTO_NAME_IPV6_ICMP_LEGACY: lib_constants.PROTO_NAME_IPV6_ICMP}
IP_PROTOCOL_NAME_ALIASES = {lib_constants.PROTO_NAME_IPV6_ICMP_LEGACY:
lib_constants.PROTO_NAME_IPV6_ICMP}
VALID_DSCP_MARKS = [0, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34,
36, 38, 40, 46, 48, 56]

View File

@ -471,7 +471,7 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase):
if rule['protocol'] in [constants.PROTO_NAME_IPV6_ENCAP,
constants.PROTO_NAME_IPV6_FRAG,
constants.PROTO_NAME_IPV6_ICMP,
n_const.PROTO_NAME_IPV6_ICMP_LEGACY,
constants.PROTO_NAME_IPV6_ICMP_LEGACY,
constants.PROTO_NAME_IPV6_NONXT,
constants.PROTO_NAME_IPV6_OPTS,
constants.PROTO_NAME_IPV6_ROUTE]:

View File

@ -26,7 +26,6 @@ from neutron._i18n import _
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
from neutron.api.v2 import base
from neutron.common import constants as n_const
from neutron.common import exceptions
from neutron.conf import quota
from neutron import manager
@ -214,12 +213,7 @@ def _validate_name_not_default(data, valid_values=None):
validators.validators['type:name_not_default'] = _validate_name_not_default
# TODO(amotoki): const.IP_PROTOCOL_MAP now comes from neutron-lib,
# so we cannot add PROTO_NAME_IPV6_ICMP_LEGACY to const.IP_PROTOCOL_MAP
# in neutron.common.constants. IP_PROTOCOL_MAP in neutron-lib should
# be updated and neutron should consume it once Mitaka backport is done.
sg_supported_protocols = ([None] + list(const.IP_PROTOCOL_MAP.keys()) +
list(n_const.IP_PROTOCOL_NAME_ALIASES.keys()))
sg_supported_protocols = ([None] + list(const.IP_PROTOCOL_MAP.keys()))
sg_supported_ethertypes = ['IPv4', 'IPv6']
SECURITYGROUPS = 'security_groups'
SECURITYGROUPRULES = 'security_group_rules'

View File

@ -20,7 +20,6 @@ from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const
from neutron import context
from neutron.db import common_db_mixin
from neutron.db import securitygroups_db
@ -149,7 +148,7 @@ class SecurityGroupDbMixinTestCase(testlib_api.SqlTestCase):
def test_validate_ethertype_and_protocol(self):
fake_ipv4_rules = [{'protocol': constants.PROTO_NAME_IPV6_ICMP,
'ethertype': constants.IPv4},
{'protocol': n_const.PROTO_NAME_IPV6_ICMP_LEGACY,
{'protocol': constants.PROTO_NAME_IPV6_ICMP_LEGACY,
'ethertype': constants.IPv4},
{'protocol': constants.PROTO_NAME_IPV6_ENCAP,
'ethertype': constants.IPv4},
@ -297,7 +296,7 @@ class SecurityGroupDbMixinTestCase(testlib_api.SqlTestCase):
(300, 1, securitygroup.SecurityGroupInvalidIcmpValue)]
for protocol in (constants.PROTO_NAME_ICMP,
constants.PROTO_NAME_IPV6_ICMP,
n_const.PROTO_NAME_IPV6_ICMP_LEGACY):
constants.PROTO_NAME_IPV6_ICMP_LEGACY):
for pmin, pmax, exception in states:
self.assertRaises(exception,
self.mixin._validate_port_range,

View File

@ -25,7 +25,6 @@ import testtools
import webob.exc
from neutron.api.v2 import attributes as attr
from neutron.common import constants as n_const
from neutron.common import exceptions as n_exc
from neutron import context
from neutron.db import db_base_plugin_v2
@ -845,7 +844,7 @@ class TestSecurityGroups(SecurityGroupDBTestCase):
direction = "ingress"
ethertype = const.IPv6
remote_ip_prefix = "2001::f401:56ff:fefe:d3dc/128"
protocol = n_const.PROTO_NAME_IPV6_ICMP_LEGACY
protocol = const.PROTO_NAME_IPV6_ICMP_LEGACY
keys = [('remote_ip_prefix', remote_ip_prefix),
('security_group_id', security_group_id),
('direction', direction),