diff --git a/openstack-common.conf b/openstack-common.conf index 729779c66..a9223df45 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -9,7 +9,6 @@ module=jsonutils module=network_utils module=sslutils module=timeutils -module=uuidutils # The base module to hold the copy of openstack.common base=oslo.messaging diff --git a/oslo/messaging/notify/notifier.py b/oslo/messaging/notify/notifier.py index 4cc025973..d9a646569 100644 --- a/oslo/messaging/notify/notifier.py +++ b/oslo/messaging/notify/notifier.py @@ -17,13 +17,13 @@ import abc import logging +import uuid from oslo.config import cfg import six from stevedore import named from oslo.messaging.openstack.common import timeutils -from oslo.messaging.openstack.common import uuidutils from oslo.messaging import serializer as msg_serializer _notifier_opts = [ @@ -152,7 +152,7 @@ class Notifier(object): payload = self._serializer.serialize_entity(ctxt, payload) ctxt = self._serializer.serialize_context(ctxt) - msg = dict(message_id=uuidutils.generate_uuid(), + msg = dict(message_id=str(uuid.uuid4()), publisher_id=publisher_id or self.publisher_id, event_type=event_type, priority=priority, diff --git a/oslo/messaging/openstack/common/uuidutils.py b/oslo/messaging/openstack/common/uuidutils.py deleted file mode 100644 index 7608acb94..000000000 --- a/oslo/messaging/openstack/common/uuidutils.py +++ /dev/null @@ -1,39 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# 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