Change imports for IP_PROTOCOL_MAP

The definition of IP_PROTOCOL_MAP in neutron core has
moved from neutron.db.securitygroups_db to
neutron.common.constants. This patch updates all imports
of such to properly reference the constant.

Change-Id: I29ca36426308cb53f76b529e1614a0f86270edd9
Closes-Bug: #1542369
This commit is contained in:
Boden R 2016-02-05 08:39:17 -07:00
parent e7012775a7
commit 440667efd5
3 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ from vmware_nsx.common import nsx_utils
LOG = log.getLogger(__name__)
# Protocol number look up for supported protocols
protocol_num_look_up = {'tcp': 6, 'icmp': 1, 'udp': 17, 'icmpv6': 58}
protocol_num_look_up = {'tcp': 6, 'icmp': 1, 'udp': 17, 'ipv6-icmp': 58}
def _convert_to_nsx_rule(session, cluster, rule, with_id=False):

View File

@ -20,7 +20,7 @@ NSX-V3 Plugin security integration module
import uuid
from neutron.db import securitygroups_db
from neutron.common import constants
from oslo_config import cfg
from oslo_log import log
@ -40,8 +40,8 @@ DEFAULT_SECTION_TAG_NAME = 'neutron_default_dfw_section'
def _get_l4_protocol_name(protocol_number):
if protocol_number is None:
return
protocol_number = securitygroups_db.IP_PROTOCOL_MAP.get(protocol_number,
protocol_number)
protocol_number = constants.IP_PROTOCOL_MAP.get(protocol_number,
protocol_number)
protocol_number = int(protocol_number)
if protocol_number == 6:
return firewall.TCP

View File

@ -2394,7 +2394,7 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
for rule in rules['security_group_rules']:
r = rule.get('security_group_rule')
port_based_proto = (self._get_ip_proto_number(r['protocol'])
in securitygroups_db.IP_PROTOCOL_MAP.values())
in constants.IP_PROTOCOL_MAP.values())
if (not port_based_proto and
(r['port_range_min'] is not None or
r['port_range_max'] is not None)):