diff --git a/contrib/rackspace/rackspace/tests/test_rackspace_cloud_server.py b/contrib/rackspace/rackspace/tests/test_rackspace_cloud_server.py index 00410e7036..ae5d71e782 100644 --- a/contrib/rackspace/rackspace/tests/test_rackspace_cloud_server.py +++ b/contrib/rackspace/rackspace/tests/test_rackspace_cloud_server.py @@ -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 diff --git a/heat/engine/clients/os/glance.py b/heat/engine/clients/os/glance.py index 47bcf63b09..a6472a7d5a 100644 --- a/heat/engine/clients/os/glance.py +++ b/heat/engine/clients/os/glance.py @@ -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__) diff --git a/heat/engine/clients/os/neutron.py b/heat/engine/clients/os/neutron.py index e7c0c284c3..3a7b78f9ed 100644 --- a/heat/engine/clients/os/neutron.py +++ b/heat/engine/clients/os/neutron.py @@ -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): diff --git a/heat/engine/resources/neutron/neutron.py b/heat/engine/resources/neutron/neutron.py index 9a9bf43727..541012ebef 100644 --- a/heat/engine/resources/neutron/neutron.py +++ b/heat/engine/resources/neutron/neutron.py @@ -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): diff --git a/heat/engine/resources/os_database.py b/heat/engine/resources/os_database.py index de5e6aa585..5668908e1f 100644 --- a/heat/engine/resources/os_database.py +++ b/heat/engine/resources/os_database.py @@ -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__) diff --git a/heat/engine/resources/server.py b/heat/engine/resources/server.py index 1ad0a550ad..04721ce113 100644 --- a/heat/engine/resources/server.py +++ b/heat/engine/resources/server.py @@ -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') diff --git a/heat/engine/service.py b/heat/engine/service.py index 33b582558f..e1fa3d7c4b 100644 --- a/heat/engine/service.py +++ b/heat/engine/service.py @@ -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') diff --git a/heat/openstack/common/uuidutils.py b/heat/openstack/common/uuidutils.py deleted file mode 100644 index 234b880c99..0000000000 --- a/heat/openstack/common/uuidutils.py +++ /dev/null @@ -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 diff --git a/heat/tests/test_server.py b/heat/tests/test_server.py index 4b79458c4f..4862322f35 100644 --- a/heat/tests/test_server.py +++ b/heat/tests/test_server.py @@ -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', diff --git a/openstack-common.conf b/openstack-common.conf index ae1eb32f63..689eea5c30 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -11,7 +11,6 @@ module=loopingcall module=policy module=service module=threadgroup -module=uuidutils module=versionutils module=middleware.request_id