From 440667efd5b8ae94887555c479227b1f4cd3c31a Mon Sep 17 00:00:00 2001 From: Boden R Date: Fri, 5 Feb 2016 08:39:17 -0700 Subject: [PATCH] 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 --- vmware_nsx/common/securitygroups.py | 2 +- vmware_nsx/nsxlib/v3/security.py | 6 +++--- vmware_nsx/plugins/nsx_mh/plugin.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vmware_nsx/common/securitygroups.py b/vmware_nsx/common/securitygroups.py index f68f595a29..0fc62fb938 100644 --- a/vmware_nsx/common/securitygroups.py +++ b/vmware_nsx/common/securitygroups.py @@ -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): diff --git a/vmware_nsx/nsxlib/v3/security.py b/vmware_nsx/nsxlib/v3/security.py index e0b26afa35..2a45ca46e5 100644 --- a/vmware_nsx/nsxlib/v3/security.py +++ b/vmware_nsx/nsxlib/v3/security.py @@ -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 diff --git a/vmware_nsx/plugins/nsx_mh/plugin.py b/vmware_nsx/plugins/nsx_mh/plugin.py index 65cf22e536..667ea1e7aa 100644 --- a/vmware_nsx/plugins/nsx_mh/plugin.py +++ b/vmware_nsx/plugins/nsx_mh/plugin.py @@ -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)):