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

Change-Id: I94c8a2b54ce00ce041038c3867e0d17123979089
This commit is contained in:
janonymous 2016-12-06 13:34:19 +05:30
parent ed5df89b15
commit 69413b91ea
2 changed files with 4 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import sys
import unittest
import uuid
from oslo_utils import uuidutils
import six.moves.urllib.parse as urlparse
DECORATOR_MODULE = 'test'
@ -61,7 +62,7 @@ class SourcePatcher(object):
if filename not in self.source_files:
with open(filename) as f:
self.source_files[filename] = self._quote(f.read())
patch_id = str(uuid.uuid4())
patch_id = uuidutils.generate_uuid()
if not patch.endswith('\n'):
patch += '\n'
self.patches[patch_id] = self._quote(patch)

View File

@ -21,6 +21,7 @@ import uuid
from debtcollector import removals
from oslo_utils import netutils
from oslo_utils import uuidutils
import six.moves
@ -30,7 +31,7 @@ def rand_uuid():
:return: a random UUID (e.g. '1dc12c7d-60eb-4b61-a7a2-17cf210155b6')
:rtype: string
"""
return str(uuid.uuid4())
return uuidutils.generate_uuid()
def rand_uuid_hex():