def verify_tunnel_range(tunnel_range, tunnel_type):
 mappings = {p_const.TYPE_GRE: is_valid_gre_id, p_const.TYPE_VXLAN: is_valid_vxlan_vni, p_const.TYPE_GENEVE: is_valid_geneve_vni}
 if (tunnel_type in mappings):
  for ident in tunnel_range:
   if (not mappings[tunnel_type](ident)):
    raise exceptions.NetworkTunnelRangeError(tunnel_range=tunnel_range, error=(_('%(id)s is not a valid %(type)s identifier') % {'id': ident, 'type': tunnel_type}))
 if (tunnel_range[1] < tunnel_range[0]):
  raise exceptions.NetworkTunnelRangeError(tunnel_range=tunnel_range, error=_('End of tunnel range is less than start of tunnel range'))

def verify_tunnel_range ( tunnel_range , tunnel_type ) : mappings = { p_const . TYPE_GRE : is_valid_gre_id , p_const . TYPE_VXLAN : is_valid_vxlan_vni , p_const . TYPE_GENEVE : is_valid_geneve_vni } if ( tunnel_type in mappings ) : for ident in tunnel_range : if ( not mappings [ tunnel_type ] ( ident ) ) : raise exceptions . NetworkTunnelRangeError ( tunnel_range = tunnel_range , error = ( _ ( '%(id)s is not a valid %(type)s identifier' ) % { 'id' : ident , 'type' : tunnel_type } ) ) if ( tunnel_range [ 1 ] < tunnel_range [ 0 ] ) : raise exceptions . NetworkTunnelRangeError ( tunnel_range = tunnel_range , error = _ ( 'End of tunnel range is less than start of tunnel range' ) )
raise an exception for invalid tunnel range or malformed range .