Replace uuid.uuid4().hex with uuidutils.generate_uuid()

Openstack common has a wrapper for generating uuids.
We should use that function to generate uuids for consistency.

Change-Id: I756b401ebd8fab3b74d3c3c7f0e93383c316310c
This commit is contained in:
Luong Anh Tuan 2017-07-17 17:38:06 +07:00
parent d84608faa3
commit 4c4f89f1aa
1 changed files with 6 additions and 6 deletions

View File

@ -16,9 +16,9 @@
import contextlib
import itertools
import json
import uuid
import mock
from oslo_utils import uuidutils
import six
import testtools
@ -99,13 +99,13 @@ class TestStorage(runtime_storage.RuntimeStorage):
def _generate_commits():
commit = {
'commit_id': str(uuid.uuid4()),
'commit_id': uuidutils.generate_uuid(),
'lines_added': 9, 'module': 'nova', 'record_type': 'commit',
'message': 'Closes bug 1212953\n\nChange-Id: '
'I33f0f37b6460dc494abf2520dc109c9893ace9e6\n',
'subject': 'Fixed affiliation of Edgar and Sumit', 'loc': 10,
'user_id': 'john_doe',
'primary_key': str(uuid.uuid4()),
'primary_key': uuidutils.generate_uuid(),
'author_email': 'john_doe@ibm.com', 'company_name': 'IBM',
'lines_deleted': 1, 'week': 2275,
'blueprint_id': None, 'bug_id': u'1212953',
@ -123,12 +123,12 @@ def _generate_marks():
'launchpad_id': 'john_doe', 'week': 2294, 'user_id': 'john_doe',
'description': 'Approved', 'author_name': 'John Doe',
'author_email': 'john_doe@gmail.com',
'primary_key': str(uuid.uuid4()) + 'Workflow',
'primary_key': uuidutils.generate_uuid() + 'Workflow',
'module': 'glance', 'patch': 2, 'record_type': 'mark',
'company_name': '*independent', 'branch': 'master',
'date': 1387860458, 'record_id': 37184, 'release': 'icehouse',
'value': 1, 'type': 'Workflow',
'review_id': str(uuid.uuid4())}
'review_id': uuidutils.generate_uuid()}
yield mark
@ -137,7 +137,7 @@ def _generate_review():
'status': 'NEW', 'review_number': 6, 'number': '60721',
'module': 'glance', 'topic': 'bug/1258999', 'record_type': 'review',
'value': -2, 'open': True,
'id': str(uuid.uuid4()),
'id': uuidutils.generate_uuid(),
'subject': 'Adding missing copy_from policy from policy.json',
'user_id': 'john_doe',
'primary_key': 'Ibc0d1fa7626629c28c514514a985a6b89db2ac69',