From a5bf502fab57453a1aedd3a53ce89eaf464e1cd9 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Fri, 12 Jun 2015 21:11:02 +0200 Subject: [PATCH] Remove duplicate tunnel id check in sync_allocations Currently, gre/vxlan sync_allocations and _parse_tunnel_ranges both check tunnel id values. This change removes the check in gre/vxlan sync_allocations as they duplicate _parse_tunnel_ranges check and is less fine. Change-Id: I5827468aeaec5d6c79d469132b129aeb7da171e2 --- neutron/plugins/ml2/drivers/type_gre.py | 7 +------ neutron/plugins/ml2/drivers/type_vxlan.py | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/neutron/plugins/ml2/drivers/type_gre.py b/neutron/plugins/ml2/drivers/type_gre.py index 18d7040f7..5db7074c7 100644 --- a/neutron/plugins/ml2/drivers/type_gre.py +++ b/neutron/plugins/ml2/drivers/type_gre.py @@ -89,12 +89,7 @@ class GreTypeDriver(type_tunnel.EndpointTunnelTypeDriver): gre_ids = set() for gre_id_range in self.tunnel_ranges: tun_min, tun_max = gre_id_range - if tun_max + 1 - tun_min > 1000000: - LOG.error(_LE("Skipping unreasonable gre ID range " - "%(tun_min)s:%(tun_max)s"), - {'tun_min': tun_min, 'tun_max': tun_max}) - else: - gre_ids |= set(moves.range(tun_min, tun_max + 1)) + gre_ids |= set(moves.range(tun_min, tun_max + 1)) session = db_api.get_session() try: diff --git a/neutron/plugins/ml2/drivers/type_vxlan.py b/neutron/plugins/ml2/drivers/type_vxlan.py index b8cdb003c..52e5f7eae 100644 --- a/neutron/plugins/ml2/drivers/type_vxlan.py +++ b/neutron/plugins/ml2/drivers/type_vxlan.py @@ -91,12 +91,7 @@ class VxlanTypeDriver(type_tunnel.EndpointTunnelTypeDriver): # determine current configured allocatable vnis vxlan_vnis = set() for tun_min, tun_max in self.tunnel_ranges: - if tun_max + 1 - tun_min > p_const.MAX_VXLAN_VNI: - LOG.error(_LE("Skipping unreasonable VXLAN VNI range " - "%(tun_min)s:%(tun_max)s"), - {'tun_min': tun_min, 'tun_max': tun_max}) - else: - vxlan_vnis |= set(moves.range(tun_min, tun_max + 1)) + vxlan_vnis |= set(moves.range(tun_min, tun_max + 1)) session = db_api.get_session() with session.begin(subtransactions=True): -- 2.45.2