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: Ifab42440663323f43a7fdb5abe3887414f60602d
Closes-Bug: #1082248
This commit is contained in:
Luong Anh Tuan 2016-11-08 13:57:22 +07:00
parent 0c3ac28a45
commit c4aa8e97df
2 changed files with 5 additions and 5 deletions

View File

@ -19,13 +19,13 @@ import filecmp
import os
import shutil
import tempfile
import uuid
from ironic_lib import utils as ironic_utils
import mock
from oslo_config import cfg
from oslo_serialization import jsonutils as json
from oslo_utils import fileutils
from oslo_utils import uuidutils
from ironic.common import boot_devices
from ironic.common import dhcp_factory
@ -302,11 +302,11 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase):
deploy_kernel, deploy_ramdisk] = [
'swift_kernel', 'swift_ramdisk']
image_info = {
'deploy_kernel': (str(uuid.uuid4()),
'deploy_kernel': (uuidutils.generate_uuid(),
os.path.join(root_dir,
self.node.uuid,
'deploy_kernel')),
'deploy_ramdisk': (str(uuid.uuid4()),
'deploy_ramdisk': (uuidutils.generate_uuid(),
os.path.join(root_dir,
self.node.uuid,
'deploy_ramdisk'))

View File

@ -12,7 +12,6 @@
"""Test class for Ironic SeaMicro driver."""
import uuid
import mock
from oslo_utils import uuidutils
@ -68,7 +67,8 @@ class Fake_Server(object):
class Fake_Volume(object):
def __init__(self, id=None, *args, **kwargs):
if id is None:
self.id = "%s/%s/%s" % ("0", "ironic-p6-6", str(uuid.uuid4()))
self.id = "%s/%s/%s" % ("0", "ironic-p6-6",
uuidutils.generate_uuid())
else:
self.id = id