diff options
author | Zuul <zuul@review.openstack.org> | 2018-08-08 18:00:11 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-08-08 18:00:11 +0000 |
commit | 9b184080fcbd3f67ba3bf626328609259ead58e8 (patch) | |
tree | 81ffa46f7ce68a2198cef6dfc366ab296464438e /novaclient/utils.py | |
parent | 33e89f99a43ca0ef4273d1896e849b7980f4769b (diff) | |
parent | 46ad782fb09d2fd325d041bfff57a030142a13ef (diff) | |
download | python-novaclient-9b184080fcbd3f67ba3bf626328609259ead58e8.tar.gz |
Merge "Use uuidutils of oslo.utils"
Diffstat (limited to 'novaclient/utils.py')
-rw-r--r-- | novaclient/utils.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/novaclient/utils.py b/novaclient/utils.py index 6de65997..05a86d92 100644 --- a/novaclient/utils.py +++ b/novaclient/utils.py @@ -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 |