]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove duplicate tunnel id check in sync_allocations
authorCedric Brandily <zzelle@gmail.com>
Fri, 12 Jun 2015 19:11:02 +0000 (21:11 +0200)
committerCedric Brandily <zzelle@gmail.com>
Fri, 12 Jun 2015 19:43:08 +0000 (21:43 +0200)
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
neutron/plugins/ml2/drivers/type_vxlan.py

index 18d7040f79ae2027c498fcc4d82a88dc3b1103f5..5db7074c73c48819729139a40ff8e749bcfed26b 100644 (file)
@@ -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:
index b8cdb003c33f02002ca5312c227df56dbefaa992..52e5f7eaee79191a4f4114c3206e89cc12e70b03 100644 (file)
@@ -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):