From 59b976fc7b13ebe8fece761e4581818b8bafe36f Mon Sep 17 00:00:00 2001 From: lizheming Date: Sat, 18 Jan 2014 14:48:31 +0800 Subject: [PATCH] Use six.move.xrange to replace xrange in python3.x, there is no method named xrange(), it has been 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: Ia901798cf16b9a48982e6845fa3e5deffc3bd509 Closes-Bug: #1268439 --- heat/common/short_id.py | 2 ++ heat/engine/dependencies.py | 2 ++ heat/engine/resources/random_string.py | 2 ++ heat/tests/test_parser.py | 1 + 4 files changed, 7 insertions(+) diff --git a/heat/common/short_id.py b/heat/common/short_id.py index 75a500b10..74769b105 100644 --- a/heat/common/short_id.py +++ b/heat/common/short_id.py @@ -19,6 +19,8 @@ each comprise 12 (lower-case) alphanumeric characters. import base64 import uuid +from six.moves import xrange + def _to_byte_string(value, num_bits): ''' diff --git a/heat/engine/dependencies.py b/heat/engine/dependencies.py index bba3c8351..bd69b9514 100644 --- a/heat/engine/dependencies.py +++ b/heat/engine/dependencies.py @@ -15,6 +15,8 @@ import collections import itertools +from six.moves import xrange + from heat.common import exception from heat.openstack.common.gettextutils import _ diff --git a/heat/engine/resources/random_string.py b/heat/engine/resources/random_string.py index 3c384e850..4ddd86774 100644 --- a/heat/engine/resources/random_string.py +++ b/heat/engine/resources/random_string.py @@ -15,6 +15,8 @@ import random import string +from six.moves import xrange + from heat.db import api as db_api from heat.engine import constraints from heat.engine import properties diff --git a/heat/tests/test_parser.py b/heat/tests/test_parser.py index 01aa072b6..7221755a2 100644 --- a/heat/tests/test_parser.py +++ b/heat/tests/test_parser.py @@ -18,6 +18,7 @@ import time from keystoneclient import exceptions as kc_exceptions from mox import IgnoreArg from oslo.config import cfg +from six.moves import xrange from heat.engine import environment from heat.common import exception