Merge "Stop using private _is_uuid_like method"

This commit is contained in:
Zuul
2022-05-13 16:30:44 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 5 deletions

View File

@@ -19,10 +19,10 @@ import logging
import iso8601 import iso8601
from novaclient import api_versions from novaclient import api_versions
import openstack.cloud._utils
from osc_lib.command import command from osc_lib.command import command
from osc_lib import exceptions from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils
from oslo_utils import uuidutils
from openstackclient.i18n import _ from openstackclient.i18n import _
@@ -152,7 +152,7 @@ class ListServerEvent(command.Lister):
# If we fail to find the resource, it is possible the server is # If we fail to find the resource, it is possible the server is
# deleted. Try once more using the <server> arg directly if it is a # deleted. Try once more using the <server> arg directly if it is a
# UUID. # UUID.
if openstack.cloud._utils._is_uuid_like(parsed_args.server): if uuidutils.is_uuid_like(parsed_args.server):
server_id = parsed_args.server server_id = parsed_args.server
else: else:
raise raise
@@ -224,7 +224,7 @@ class ShowServerEvent(command.ShowOne):
# If we fail to find the resource, it is possible the server is # If we fail to find the resource, it is possible the server is
# deleted. Try once more using the <server> arg directly if it is a # deleted. Try once more using the <server> arg directly if it is a
# UUID. # UUID.
if openstack.cloud._utils._is_uuid_like(parsed_args.server): if uuidutils.is_uuid_like(parsed_args.server):
server_id = parsed_args.server server_id = parsed_args.server
else: else:
raise raise

View File

@@ -21,7 +21,6 @@ import logging
import os import os
import sys import sys
import openstack.cloud._utils
from openstack.image import image_signer from openstack.image import image_signer
from osc_lib.api import utils as api_utils from osc_lib.api import utils as api_utils
from osc_lib.cli import format_columns from osc_lib.cli import format_columns
@@ -29,6 +28,7 @@ from osc_lib.cli import parseractions
from osc_lib.command import command from osc_lib.command import command
from osc_lib import exceptions from osc_lib import exceptions
from osc_lib import utils from osc_lib import utils
from oslo_utils import uuidutils
from openstackclient.common import progressbar from openstackclient.common import progressbar
from openstackclient.i18n import _ from openstackclient.i18n import _
@@ -159,7 +159,7 @@ class AddProjectToImage(command.ShowOne):
image_client = self.app.client_manager.image image_client = self.app.client_manager.image
identity_client = self.app.client_manager.identity identity_client = self.app.client_manager.identity
if openstack.cloud._utils._is_uuid_like(parsed_args.project): if uuidutils.is_uuid_like(parsed_args.project):
project_id = parsed_args.project project_id = parsed_args.project
else: else:
project_id = common.find_project( project_id = common.find_project(