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
This commit is contained in:
Thomas Bechtold 2014-12-23 10:45:30 +01:00
parent 303daaf803
commit 48cc1b75ed
5 changed files with 4 additions and 41 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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