From 48cc1b75edfb81c343bcef5ef5132960474f2fe5 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Tue, 23 Dec 2014 10:45:30 +0100 Subject: [PATCH] Use uuidutils from oslo.utils Remove file from oslo-incubator and switch to oslo.utils library which is already a requirement for Manila. Change-Id: Ic889fb52b1cc6a1ef2e44729eb0904875d3e85f0 --- bin/manila-manage | 2 +- manila/api/v1/shares.py | 2 +- manila/openstack/common/uuidutils.py | 37 ---------------------------- manila/tests/test_db.py | 3 ++- openstack-common.conf | 1 - 5 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 manila/openstack/common/uuidutils.py diff --git a/bin/manila-manage b/bin/manila-manage index f2ca1a0dd3..3a955c9f3f 100755 --- a/bin/manila-manage +++ b/bin/manila-manage @@ -71,6 +71,7 @@ from manila import i18n i18n.enable_lazy() from oslo.config import cfg +from oslo.utils import uuidutils from manila.common import config # Need to register global_opts # noqa from manila import context @@ -78,7 +79,6 @@ from manila import db from manila.db import migration from manila.i18n import _ from manila.openstack.common import log as logging -from manila.openstack.common import uuidutils from manila import utils from manila import version diff --git a/manila/api/v1/shares.py b/manila/api/v1/shares.py index f620c70258..37b9b36ef3 100644 --- a/manila/api/v1/shares.py +++ b/manila/api/v1/shares.py @@ -17,6 +17,7 @@ import ast +from oslo.utils import uuidutils import six import webob from webob import exc @@ -29,7 +30,6 @@ from manila import exception from manila.i18n import _ from manila.i18n import _LI from manila.openstack.common import log as logging -from manila.openstack.common import uuidutils from manila import share from manila.share import volume_types diff --git a/manila/openstack/common/uuidutils.py b/manila/openstack/common/uuidutils.py deleted file mode 100644 index 234b880c99..0000000000 --- a/manila/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/manila/tests/test_db.py b/manila/tests/test_db.py index cb959aec02..02895934b8 100644 --- a/manila/tests/test_db.py +++ b/manila/tests/test_db.py @@ -15,10 +15,11 @@ """Tests for the ShareServer and ShareServerBackendDetails tables.""" +from oslo.utils import uuidutils + from manila import context from manila import db from manila import exception -from manila.openstack.common import uuidutils from manila import test diff --git a/openstack-common.conf b/openstack-common.conf index 0a92b16b86..ff3a5bb63c 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -15,7 +15,6 @@ module=service module=sslutils module=systemd module=threadgroup -module=uuidutils # The list of scripts to copy from oslo common code script = tools/colorizer.py