Replace str(uuid.uuid4) with uuidutils.generate_uuid()
Change-Id: I94c8a2b54ce00ce041038c3867e0d17123979089
This commit is contained in:
parent
ed5df89b15
commit
69413b91ea
|
@ -23,6 +23,7 @@ import sys
|
||||||
import unittest
|
import unittest
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from oslo_utils import uuidutils
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
DECORATOR_MODULE = 'test'
|
DECORATOR_MODULE = 'test'
|
||||||
|
@ -61,7 +62,7 @@ class SourcePatcher(object):
|
||||||
if filename not in self.source_files:
|
if filename not in self.source_files:
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
self.source_files[filename] = self._quote(f.read())
|
self.source_files[filename] = self._quote(f.read())
|
||||||
patch_id = str(uuid.uuid4())
|
patch_id = uuidutils.generate_uuid()
|
||||||
if not patch.endswith('\n'):
|
if not patch.endswith('\n'):
|
||||||
patch += '\n'
|
patch += '\n'
|
||||||
self.patches[patch_id] = self._quote(patch)
|
self.patches[patch_id] = self._quote(patch)
|
||||||
|
|
|
@ -21,6 +21,7 @@ import uuid
|
||||||
|
|
||||||
from debtcollector import removals
|
from debtcollector import removals
|
||||||
from oslo_utils import netutils
|
from oslo_utils import netutils
|
||||||
|
from oslo_utils import uuidutils
|
||||||
import six.moves
|
import six.moves
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ def rand_uuid():
|
||||||
:return: a random UUID (e.g. '1dc12c7d-60eb-4b61-a7a2-17cf210155b6')
|
:return: a random UUID (e.g. '1dc12c7d-60eb-4b61-a7a2-17cf210155b6')
|
||||||
:rtype: string
|
:rtype: string
|
||||||
"""
|
"""
|
||||||
return str(uuid.uuid4())
|
return uuidutils.generate_uuid()
|
||||||
|
|
||||||
|
|
||||||
def rand_uuid_hex():
|
def rand_uuid_hex():
|
||||||
|
|
Loading…
Reference in New Issue