Use uuidutils of oslo.utils
Replace standard uuid library with uuidutils of oslo.utils. TrivialFix Change-Id: Ibb6ec8b56a404685d9727f1b771dbff178fdecdf
This commit is contained in:
parent
045f641cec
commit
46ad782fb0
|
@ -14,10 +14,10 @@
|
|||
# under the License.
|
||||
|
||||
import copy
|
||||
import uuid
|
||||
|
||||
from keystoneauth1 import session
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
import novaclient.api_versions
|
||||
import novaclient.client
|
||||
|
@ -72,7 +72,7 @@ class SessionClientTest(utils.TestCase):
|
|||
self.assertEqual(0, len(cs.get_timings()))
|
||||
|
||||
def test_global_id(self):
|
||||
global_id = "req-%s" % uuid.uuid4()
|
||||
global_id = "req-%s" % uuidutils.generate_uuid()
|
||||
self.requests_mock.get('http://no.where')
|
||||
|
||||
client = novaclient.client.SessionClient(session=session.Session(),
|
||||
|
|
|
@ -16,10 +16,10 @@ import os
|
|||
import re
|
||||
import textwrap
|
||||
import time
|
||||
import uuid
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import uuidutils
|
||||
import prettytable
|
||||
import six
|
||||
from six.moves.urllib import parse
|
||||
|
@ -255,9 +255,9 @@ def find_resource(manager, name_or_id, wrap_exception=True, **find_args):
|
|||
if six.PY3:
|
||||
tmp_id = tmp_id.decode()
|
||||
|
||||
uuid.UUID(tmp_id)
|
||||
return manager.get(tmp_id)
|
||||
except (TypeError, ValueError, exceptions.NotFound):
|
||||
if uuidutils.is_uuid_like(tmp_id):
|
||||
return manager.get(tmp_id)
|
||||
except (TypeError, exceptions.NotFound):
|
||||
pass
|
||||
|
||||
# then try to get entity as name
|
||||
|
|
Loading…
Reference in New Issue