]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix bug:range() is not same in py3.x and py2.x
authorlizheming <lizheming.li@huawei.com>
Fri, 17 Jan 2014 03:58:42 +0000 (11:58 +0800)
committerlizheming <lizheming.li@huawei.com>
Tue, 11 Mar 2014 08:44:47 +0000 (16:44 +0800)
in python3.x, there is no method named xrange(),
it has replaced by range(),which is equal to xrange() in python2.x.
so we must fix this issue.we use six module to fix this issue.

Change-Id: I9cee3f0df2d8abbf6f66d7c5a3a0fed98df622e8
Closes-Bug: #1268439

24 files changed:
neutron/db/sqlalchemyutils.py
neutron/plugins/bigswitch/tests/test_server.py
neutron/plugins/brocade/vlanbm.py
neutron/plugins/cisco/db/n1kv_db_v2.py
neutron/plugins/hyperv/db.py
neutron/plugins/linuxbridge/db/l2network_db_v2.py
neutron/plugins/ml2/drivers/type_gre.py
neutron/plugins/ml2/drivers/type_vlan.py
neutron/plugins/mlnx/db/mlnx_db_v2.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/plugins/openvswitch/ovs_db_v2.py
neutron/services/loadbalancer/drivers/haproxy/cfg.py
neutron/tests/functional/agent/linux/test_async_process.py
neutron/tests/unit/bigswitch/test_router_db.py
neutron/tests/unit/cisco/n1kv/test_n1kv_db.py
neutron/tests/unit/linuxbridge/test_lb_db.py
neutron/tests/unit/ml2/test_type_gre.py
neutron/tests/unit/ml2/test_type_vxlan.py
neutron/tests/unit/mlnx/test_mlnx_db.py
neutron/tests/unit/nec/test_nec_agent.py
neutron/tests/unit/nec/test_trema_driver.py
neutron/tests/unit/openvswitch/test_ovs_db.py
neutron/tests/unit/services/loadbalancer/drivers/test_agent_driver_base.py
neutron/tests/unit/test_post_mortem_debug.py

index d012a85a184f1ae248e9639b00e02990c9bcebed..23dd6447f9ce6ebdfbc6ca69b44535fd77e74683 100644 (file)
@@ -15,6 +15,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from six.moves import xrange
 import sqlalchemy
 from sqlalchemy.orm.properties import RelationshipProperty
 
index a3bfccdede279cecf6f538fb27d8afb2d5804afd..8725adbb6c14a04c9c35a6e20215c89f46513ddb 100755 (executable)
@@ -27,6 +27,7 @@ from __future__ import print_function
 import json
 import re
 
+from six.moves import xrange
 from wsgiref.simple_server import make_server
 
 
index 37a43a1126ce0a1ed781f8c811e426c48b922d75..ecb334478ea90da097bf47e4e06b23adc651cf55 100644 (file)
@@ -21,6 +21,7 @@
 
 
 """A Vlan Bitmap class to handle allocation/de-allocation of vlan ids."""
+from six.moves import xrange
 
 from neutron.common import constants
 from neutron.plugins.brocade.db import models as brocade_db
index 3299d0cb73d90bfe6eb7f8353f4702752729cef5..76a99de3f02d576568b8305738eaca347d9f3640 100644 (file)
@@ -21,6 +21,7 @@
 
 import netaddr
 import re
+from six.moves import xrange
 from sqlalchemy.orm import exc
 from sqlalchemy.sql import and_
 
index fae554a3f3bca0a30093b40ca0369a6a621fdbb5..97ac59ab25f6cf2a9fb1f1ecbc5076ce8999c763 100644 (file)
@@ -16,6 +16,7 @@
 #    under the License.
 # @author: Alessandro Pilotti, Cloudbase Solutions Srl
 
+from six.moves import xrange
 from sqlalchemy.orm import exc
 
 from neutron.common import exceptions as n_exc
index 3178e4588a2477f74cbf4c775b4161868e3a95a6..4ad72bb9ca2805cc3f4c3912cdba988d53f728fd 100644 (file)
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
+from six.moves import xrange
 from sqlalchemy.orm import exc
 
 from neutron.common import exceptions as n_exc
index 4af80150796522470d84074190bb86b897cf8fac..850f1f1a0128afad582cc4b154492a4146b844a5 100644 (file)
@@ -14,6 +14,7 @@
 #    under the License.
 
 from oslo.config import cfg
+from six.moves import xrange
 import sqlalchemy as sa
 from sqlalchemy.orm import exc as sa_exc
 
index 1855d8e678202fdd39c0eebc59fe89c82b132480..7bdc815258465653e632d957e5ece49a3ebd428c 100644 (file)
@@ -16,6 +16,7 @@
 import sys
 
 from oslo.config import cfg
+from six.moves import xrange
 import sqlalchemy as sa
 
 from neutron.common import constants as q_const
index b197d689927d6fc2c486cda5a3f704a2d049e295..856d1e44b2d510713cdc0838077d01008e297e66 100644 (file)
@@ -15,6 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from six.moves import xrange
 from sqlalchemy.orm import exc
 
 from neutron.common import exceptions as n_exc
index 9028b23fb9713fced7f5e325fca6eac16fc77010..9df64a061b6de52fa1318af9adcca6bb92b4adaf 100644 (file)
@@ -21,6 +21,7 @@ import time
 import eventlet
 import netaddr
 from oslo.config import cfg
+from six.moves import xrange
 
 from neutron.agent import l2population_rpc
 from neutron.agent.linux import ip_lib
index e162565abb1cc31b72cbad9b1c6f24cb9862a04d..6054b134af4c0faa77a7a1040a923415d6f8c882 100644 (file)
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from six.moves import xrange
 from sqlalchemy import func
 from sqlalchemy.orm import exc
 
index 74447c6b55704b929936901b50fe7596c52ba24c..8e7b4090a1aa1cb94c7a1894bc87093ff279b2d4 100644 (file)
@@ -17,6 +17,7 @@
 # @author: Mark McClain, DreamHost
 
 import itertools
+from six.moves import xrange
 
 from neutron.agent.linux import utils
 from neutron.plugins.common import constants as qconstants
index 062cbc523ff9eac2c856c7dde13fe69db14cd4df..3d829d6896b17d2789180287dfac5c4c34104a40 100644 (file)
@@ -17,6 +17,8 @@
 import eventlet
 import fixtures
 
+from six.moves import xrange
+
 from neutron.agent.linux import async_process
 from neutron.tests import base
 
index c18168e10186adc160b54581c653c24a734c5e6a..0b1384cf5641703071ed76767190e27fe9ae4da9 100644 (file)
@@ -23,6 +23,7 @@ import copy
 
 from mock import patch
 from oslo.config import cfg
+from six.moves import xrange
 from webob import exc
 
 from neutron.common.test_lib import test_config
index 07c059aef44692ff8b71c52ac5b27657dcd482e7..8acec2b8d797ea14be76bab4610eaf8e1c93afd2 100644 (file)
@@ -18,6 +18,7 @@
 # @author: Abhishek Raut, Cisco Systems Inc.
 # @author: Rudrajit Tapadar, Cisco Systems Inc.
 
+from six.moves import xrange
 from sqlalchemy.orm import exc as s_exc
 from testtools import matchers
 
index 63b216c7dfa55e34db11cb5c5f47d9bdbe3c70ae..59d1086f66c6cec0ef040a08401dafe8fe218f97 100644 (file)
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 from oslo.config import cfg
+from six.moves import xrange
 import testtools
 from testtools import matchers
 
index dd52f0dbf8668fca258bc0d8ae4c0a31cff0fc03..b45ed8378dcf795e5088536d0f46978f4611e226 100644 (file)
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from six.moves import xrange
 import testtools
 from testtools import matchers
 
index 1aad48e755229345a90cc82abe4fc4b18ef7300e..4fa9fbee923c5a433af6ccc7743309ff4d81814a 100644 (file)
@@ -15,6 +15,7 @@
 # @author: Kyle Mestery, Cisco Systems, Inc.
 
 from oslo.config import cfg
+from six.moves import xrange
 import testtools
 from testtools import matchers
 
index ec2621453ecedc043541b5c03ea5b96ce44e9313..51aadb9db5e60854a8cda99af2529cccf84a1678 100644 (file)
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from six.moves import xrange
 from testtools import matchers
 
 from neutron.common import exceptions as n_exc
index 341eaf77498102982d482ef2c03f4ffdde2116e5..51c8c0b6f934c038db90b10811595337d84bcbbd 100644 (file)
@@ -21,6 +21,7 @@ import time
 
 import mock
 from oslo.config import cfg
+from six.moves import xrange
 import testtools
 
 from neutron.agent.linux import ovs_lib
index 16b838e4c4c7ebf4b1ef90b5aafd79e39a47f952..8c8ce987c755c7b90d20b951127b0be31d2f429e 100644 (file)
@@ -18,6 +18,7 @@
 import random
 
 import mock
+from six.moves import xrange
 
 from neutron.openstack.common import uuidutils
 from neutron.plugins.nec.common import ofc_client
index 5ebb0c0f20fadda03a03d2f2e78e567369f39307..f9896e4acc7d6523bb1eff9aa5c56b0d639e3cea 100644 (file)
@@ -17,6 +17,7 @@
 
 import mock
 from oslo.config import cfg
+from six.moves import xrange
 import testtools
 from testtools import matchers
 
index de9e8fbd654cc79f56d2d6ddc75194c0801e928b..6614ab9f1df3bb5b5f0241cd3dd7a1214865d10c 100644 (file)
@@ -19,6 +19,7 @@
 import contextlib
 
 import mock
+from six.moves import xrange
 from webob import exc
 
 from neutron.common import exceptions
index 458170924ddbd13f26afd9b74e7fe448c8704cf3..ffef668bb05dd6727f219787c43c5b03373b80e8 100644 (file)
@@ -18,6 +18,7 @@
 import sys
 
 import mock
+from six.moves import xrange
 
 from neutron.tests import base
 from neutron.tests import post_mortem_debug