Merge "Replace str(uuid.uuid4) with uuidutils.generate_uuid()"
diff --git a/tempest/lib/cmd/check_uuid.py b/tempest/lib/cmd/check_uuid.py
index 1239ac5..88ce775 100755
--- a/tempest/lib/cmd/check_uuid.py
+++ b/tempest/lib/cmd/check_uuid.py
@@ -23,6 +23,7 @@
import unittest
import uuid
+from oslo_utils import uuidutils
import six.moves.urllib.parse as urlparse
DECORATOR_MODULE = 'test'
@@ -61,7 +62,7 @@
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)
diff --git a/tempest/lib/common/utils/data_utils.py b/tempest/lib/common/utils/data_utils.py
index 4095c77..75c2e51 100644
--- a/tempest/lib/common/utils/data_utils.py
+++ b/tempest/lib/common/utils/data_utils.py
@@ -21,6 +21,7 @@
from debtcollector import removals
from oslo_utils import netutils
+from oslo_utils import uuidutils
import six.moves
@@ -30,7 +31,7 @@
: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():