From 2138734b13ea73b3caed8607195b7398e5fc2cab Mon Sep 17 00:00:00 2001 From: John Griffith Date: Wed, 13 Nov 2013 15:29:32 -0700 Subject: [PATCH] Remove the use of common.uuidutils.gen_uuid There's a movement to remove gen_uuid from the openstack common. This change removes it's use from Cinder and just puts the call inline. Change-Id: I07329bab9553e15e498ddbda3848d50b8f48fd53 --- cinder/taskflow/patterns/base.py | 4 ++-- cinder/taskflow/utils.py | 4 ++-- cinder/tests/keymgr/mock_key_mgr.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cinder/taskflow/patterns/base.py b/cinder/taskflow/patterns/base.py index 7f47debd9..20ab9d1ef 100644 --- a/cinder/taskflow/patterns/base.py +++ b/cinder/taskflow/patterns/base.py @@ -18,10 +18,10 @@ import abc import threading +import uuid as uuidlib import six -from cinder.openstack.common import uuidutils from cinder.taskflow import decorators from cinder.taskflow import exceptions as exc @@ -94,7 +94,7 @@ class Flow(object): if uuid: self._id = str(uuid) else: - self._id = uuidutils.generate_uuid() + self._id = str(uuidlib.uuid4()) @property def name(self): diff --git a/cinder/taskflow/utils.py b/cinder/taskflow/utils.py index 81d53d8d0..44a526c6d 100644 --- a/cinder/taskflow/utils.py +++ b/cinder/taskflow/utils.py @@ -25,8 +25,8 @@ import sys import threading import time import types +import uuid as uuidlib -from cinder.openstack.common import uuidutils from cinder.taskflow import decorators @@ -202,7 +202,7 @@ class Runner(object): self.runs_before = [] self.result = None if not uuid: - self._id = uuidutils.generate_uuid() + self._id = str(uuidlib.uuid4()) else: self._id = str(uuid) diff --git a/cinder/tests/keymgr/mock_key_mgr.py b/cinder/tests/keymgr/mock_key_mgr.py index ac8fd7d53..beeb376c2 100644 --- a/cinder/tests/keymgr/mock_key_mgr.py +++ b/cinder/tests/keymgr/mock_key_mgr.py @@ -28,11 +28,11 @@ this class. """ import array +import uuid from cinder import exception from cinder.keymgr import key from cinder.keymgr import key_mgr -from cinder.openstack.common import uuidutils from cinder import utils @@ -77,9 +77,9 @@ class MockKeyManager(key_mgr.KeyManager): return self.store_key(ctxt, key) def _generate_key_id(self): - key_id = uuidutils.generate_uuid() + key_id = str(uuid.uuid4()) while key_id in self.keys: - key_id = uuidutils.generate_uuid() + key_id = str(uuid.uuid4()) return key_id -- 2.45.2