From ef6c1cb9ce0e56ed7b629f4e239083e67eee13a1 Mon Sep 17 00:00:00 2001 From: Luong Anh Tuan Date: Tue, 8 Nov 2016 14:13:05 +0700 Subject: [PATCH] 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: Ifb7b15fc8634338fc535de8043053e41aa93968a Closes-Bug: #1082248 --- ironic_python_agent/extensions/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ironic_python_agent/extensions/base.py b/ironic_python_agent/extensions/base.py index e93b00b4d..b026dece8 100644 --- a/ironic_python_agent/extensions/base.py +++ b/ironic_python_agent/extensions/base.py @@ -16,14 +16,15 @@ import collections import functools import inspect import threading -import uuid from oslo_log import log +from oslo_utils import uuidutils import six from ironic_python_agent import encoding from ironic_python_agent import errors + LOG = log.getLogger() @@ -48,7 +49,7 @@ class BaseCommandResult(encoding.SerializableComparable): :param command_params: parameters passed to command """ - self.id = six.text_type(uuid.uuid4()) + self.id = uuidutils.generate_uuid() self.command_name = command_name self.command_params = command_params self.command_status = AgentCommandStatus.RUNNING