summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangguoqing <zhang.guoqing@99cloud.net>2016-12-07 02:41:10 +0000
committerzhangguoqing <zhang.guoqing@99cloud.net>2016-12-07 02:53:17 +0000
commitd77439bd9306a7e7f2da748a1a8fec757953ed3a (patch)
treeece4ed061f5e6b6d346a7ed6dca848abc763bf30
parente8e2421f8bc7ae861061bc5cef89934e0bccfdaf (diff)
downloadoslo-db-d77439bd9306a7e7f2da748a1a8fec757953ed3a.tar.gz
Replaces uuid.uuid4 with uuidutils.generate_uuid()
Openstack common has a wrapper for generating uuids. We should use that function when generating uuids for consistency. Change-Id: I927609f06e5921e189487160ef46be830e422add Closes-Bug: #1082248
-rw-r--r--oslo_db/tests/sqlalchemy/test_utils.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/oslo_db/tests/sqlalchemy/test_utils.py b/oslo_db/tests/sqlalchemy/test_utils.py
index f0ace00..7423e9d 100644
--- a/oslo_db/tests/sqlalchemy/test_utils.py
+++ b/oslo_db/tests/sqlalchemy/test_utils.py
@@ -13,10 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-import uuid
-
import fixtures
import mock
+from oslo_utils import uuidutils
from oslotest import base as test_base
from oslotest import moxstubout
import six
@@ -726,7 +725,7 @@ class TestMigrationUtils(db_test_base.DbTestCase):
select_table_name = "__test_select_from_table__"
uuidstrs = []
for unused in range(10):
- uuidstrs.append(uuid.uuid4().hex)
+ uuidstrs.append(uuidutils.generate_uuid(dashed=False))
insert_table = Table(
insert_table_name, self.meta,
Column('id', Integer, primary_key=True,
@@ -766,7 +765,7 @@ class TestMigrationUtils(db_test_base.DbTestCase):
select_table_name = "__test_select_from_table__"
uuidstrs = []
for unused in range(10):
- uuidstrs.append(uuid.uuid4().hex)
+ uuidstrs.append(uuidutils.generate_uuid(dashed=False))
insert_table = Table(
insert_table_name, self.meta,
Column('id', Integer, primary_key=True,
@@ -806,7 +805,7 @@ class TestMigrationUtils(db_test_base.DbTestCase):
select_table_name = "__test_select_from_table__"
uuidstrs = []
for unused in range(10):
- uuidstrs.append(uuid.uuid4().hex)
+ uuidstrs.append(uuidutils.generate_uuid(dashed=False))
insert_table = Table(
insert_table_name, self.meta,
Column('id', Integer, primary_key=True,