Merge "Switch to oslo.utils.uuidutils"
This commit is contained in:
commit
d5de387c86
|
@ -14,6 +14,7 @@
|
|||
import mock
|
||||
import mox
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import uuidutils
|
||||
import six
|
||||
|
||||
from heat.common import exception
|
||||
|
@ -23,7 +24,6 @@ from heat.engine import parser
|
|||
from heat.engine import resource
|
||||
from heat.engine import scheduler
|
||||
from heat.engine import template
|
||||
from heat.openstack.common import uuidutils
|
||||
from heat.tests import common
|
||||
from heat.tests import utils
|
||||
from heat.tests.v1_1 import fakes
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
from glanceclient import client as gc
|
||||
from glanceclient import exc
|
||||
from oslo.utils import uuidutils
|
||||
|
||||
from heat.common import exception
|
||||
from heat.common.i18n import _
|
||||
|
@ -20,7 +21,6 @@ from heat.common.i18n import _LI
|
|||
from heat.engine.clients import client_plugin
|
||||
from heat.engine import constraints
|
||||
from heat.openstack.common import log as logging
|
||||
from heat.openstack.common import uuidutils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
from neutronclient.common import exceptions
|
||||
from neutronclient.neutron import v2_0 as neutronV20
|
||||
from neutronclient.v2_0 import client as nc
|
||||
from oslo.utils import uuidutils
|
||||
|
||||
from heat.common import exception
|
||||
from heat.engine.clients import client_plugin
|
||||
from heat.engine import constraints
|
||||
from heat.openstack.common import uuidutils
|
||||
|
||||
|
||||
class NeutronClientPlugin(client_plugin.ClientPlugin):
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from oslo.utils import uuidutils
|
||||
import six
|
||||
|
||||
import warnings
|
||||
|
@ -18,7 +19,6 @@ from heat.common import exception
|
|||
from heat.common.i18n import _
|
||||
from heat.engine import resource
|
||||
from heat.engine import scheduler
|
||||
from heat.openstack.common import uuidutils
|
||||
|
||||
|
||||
class NeutronResource(resource.Resource):
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from oslo.utils import uuidutils
|
||||
|
||||
from heat.common import exception
|
||||
from heat.common.i18n import _
|
||||
|
@ -21,7 +22,6 @@ from heat.engine import properties
|
|||
from heat.engine import resource
|
||||
from heat.engine import support
|
||||
from heat.openstack.common import log as logging
|
||||
from heat.openstack.common import uuidutils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import uuid
|
|||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import uuidutils
|
||||
|
||||
from heat.common import exception
|
||||
from heat.common.i18n import _
|
||||
|
@ -30,7 +31,6 @@ from heat.engine import scheduler
|
|||
from heat.engine import stack_user
|
||||
from heat.engine import support
|
||||
from heat.openstack.common import log as logging
|
||||
from heat.openstack.common import uuidutils
|
||||
from heat.rpc import api as rpc_api
|
||||
|
||||
cfg.CONF.import_opt('instance_user', 'heat.common.config')
|
||||
|
|
|
@ -20,6 +20,7 @@ import eventlet
|
|||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import uuidutils
|
||||
from osprofiler import profiler
|
||||
import requests
|
||||
import six
|
||||
|
@ -51,7 +52,6 @@ from heat.engine import watchrule
|
|||
from heat.openstack.common import log as logging
|
||||
from heat.openstack.common import service
|
||||
from heat.openstack.common import threadgroup
|
||||
from heat.openstack.common import uuidutils
|
||||
from heat.rpc import api as rpc_api
|
||||
|
||||
cfg.CONF.import_opt('engine_life_check_timeout', 'heat.common.config')
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
# Copyright (c) 2012 Intel Corporation.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""
|
||||
UUID related utilities and helper functions.
|
||||
"""
|
||||
|
||||
import uuid
|
||||
|
||||
|
||||
def generate_uuid():
|
||||
return str(uuid.uuid4())
|
||||
|
||||
|
||||
def is_uuid_like(val):
|
||||
"""Returns validation of a value as a UUID.
|
||||
|
||||
For our purposes, a UUID is a canonical form string:
|
||||
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
|
||||
|
||||
"""
|
||||
try:
|
||||
return str(uuid.UUID(val)) == val
|
||||
except (TypeError, ValueError, AttributeError):
|
||||
return False
|
|
@ -13,9 +13,9 @@
|
|||
|
||||
import collections
|
||||
import copy
|
||||
from oslo.utils import uuidutils
|
||||
import six
|
||||
from six.moves.urllib import parse as urlparse
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
import mox
|
||||
|
@ -34,7 +34,6 @@ from heat.engine import resource
|
|||
from heat.engine.resources import server as servers
|
||||
from heat.engine import scheduler
|
||||
from heat.engine import template
|
||||
from heat.openstack.common import uuidutils
|
||||
from heat.tests import common
|
||||
from heat.tests import utils
|
||||
from heat.tests.v1_1 import fakes as fakes_v1_1
|
||||
|
@ -123,7 +122,7 @@ class ServersTest(common.HeatTestCase):
|
|||
templ = template.Template(t)
|
||||
stack = parser.Stack(utils.dummy_context(), stack_name, templ,
|
||||
environment.Environment({'key_name': 'test'}),
|
||||
stack_id=str(uuid.uuid4()),
|
||||
stack_id=uuidutils.generate_uuid(),
|
||||
stack_user_project_id='8888')
|
||||
return (templ, stack)
|
||||
|
||||
|
@ -973,7 +972,7 @@ class ServersTest(common.HeatTestCase):
|
|||
t = template_format.parse(nova_keypair_template)
|
||||
templ = template.Template(t)
|
||||
stack = parser.Stack(utils.dummy_context(), stack_name, templ,
|
||||
stack_id=str(uuid.uuid4()))
|
||||
stack_id=uuidutils.generate_uuid())
|
||||
|
||||
resource_defns = templ.resource_definitions(stack)
|
||||
server = servers.Server('server_validate_test',
|
||||
|
|
|
@ -11,7 +11,6 @@ module=loopingcall
|
|||
module=policy
|
||||
module=service
|
||||
module=threadgroup
|
||||
module=uuidutils
|
||||
module=versionutils
|
||||
module=middleware.request_id
|
||||
|
||||
|
|
Loading…
Reference in New Issue