Skip to content

Commit afc5f99

Browse files
committed
Stop using private _is_uuid_like method
currently this double-private method of a dependency library is used in several places (openstack.cloud._utils._is_uuid_like) openstacksdk deliberatly chose not to depend on oslo.utils to keep dependenies to the minimum, so it just copied several methods from it, including the is_uuid_like. python-openstackclient however already depends on oslo.utils, so using the public method from oslo.utils should be preferred and more stable. Change-Id: I578ffa36ffb00c9d47ee12a149313201973edd32
1 parent dabaec5 commit afc5f99

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

openstackclient/compute/v2/server_event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919

2020
import iso8601
2121
from novaclient import api_versions
22-
import openstack.cloud._utils
2322
from osc_lib.command import command
2423
from osc_lib import exceptions
2524
from osc_lib import utils
25+
from oslo_utils import uuidutils
2626

2727
from openstackclient.i18n import _
2828

@@ -152,7 +152,7 @@ def take_action(self, parsed_args):
152152
# If we fail to find the resource, it is possible the server is
153153
# deleted. Try once more using the <server> arg directly if it is a
154154
# UUID.
155-
if openstack.cloud._utils._is_uuid_like(parsed_args.server):
155+
if uuidutils.is_uuid_like(parsed_args.server):
156156
server_id = parsed_args.server
157157
else:
158158
raise
@@ -224,7 +224,7 @@ def take_action(self, parsed_args):
224224
# If we fail to find the resource, it is possible the server is
225225
# deleted. Try once more using the <server> arg directly if it is a
226226
# UUID.
227-
if openstack.cloud._utils._is_uuid_like(parsed_args.server):
227+
if uuidutils.is_uuid_like(parsed_args.server):
228228
server_id = parsed_args.server
229229
else:
230230
raise

openstackclient/image/v2/image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
import os
2222
import sys
2323

24-
import openstack.cloud._utils
2524
from openstack.image import image_signer
2625
from osc_lib.api import utils as api_utils
2726
from osc_lib.cli import format_columns
2827
from osc_lib.cli import parseractions
2928
from osc_lib.command import command
3029
from osc_lib import exceptions
3130
from osc_lib import utils
31+
from oslo_utils import uuidutils
3232

3333
from openstackclient.common import progressbar
3434
from openstackclient.i18n import _
@@ -159,7 +159,7 @@ def take_action(self, parsed_args):
159159
image_client = self.app.client_manager.image
160160
identity_client = self.app.client_manager.identity
161161

162-
if openstack.cloud._utils._is_uuid_like(parsed_args.project):
162+
if uuidutils.is_uuid_like(parsed_args.project):
163163
project_id = parsed_args.project
164164
else:
165165
project_id = common.find_project(

0 commit comments

Comments
 (0)