diff --git a/manila/db/sqlalchemy/api.py b/manila/db/sqlalchemy/api.py index 84fe8bd363..f112aedfeb 100644 --- a/manila/db/sqlalchemy/api.py +++ b/manila/db/sqlalchemy/api.py @@ -40,7 +40,6 @@ from manila.db.sqlalchemy.session import get_session from manila import exception from manila.openstack.common import log as logging from manila.openstack.common import timeutils -from manila.openstack.common import uuidutils CONF = cfg.CONF @@ -1433,7 +1432,7 @@ def _share_metadata_get_item(context, share_id, key, session=None): @require_context def security_service_create(context, values): if not values.get('id'): - values['id'] = uuidutils.generate_uuid() + values['id'] = str(uuid.uuid4()) security_service_ref = models.SecurityService() security_service_ref.update(values) @@ -1509,7 +1508,7 @@ def _network_get_query(context, session=None): @require_context def share_network_create(context, values): if not values.get('id'): - values['id'] = uuidutils.generate_uuid() + values['id'] = str(uuid.uuid4()) network_ref = models.ShareNetwork() network_ref.update(values) diff --git a/manila/tests/fake_network.py b/manila/tests/fake_network.py index 4567204ae8..ba0a796751 100644 --- a/manila/tests/fake_network.py +++ b/manila/tests/fake_network.py @@ -15,11 +15,11 @@ # # vim: tabstop=4 shiftwidth=4 softtabstop=4 +import uuid from oslo.config import cfg from manila.openstack.common import log as logging -from manila.openstack.common import uuidutils CONF = cfg.CONF @@ -112,11 +112,11 @@ class API(object): def get_all_tenant_networks(self, tenant_id): net1 = self.network.copy() net1['tenant_id'] = tenant_id - net1['id'] = uuidutils.generate_uuid() + net1['id'] = str(uuid.uuid4()) net2 = self.network.copy() net2['tenant_id'] = tenant_id - net2['id'] = uuidutils.generate_uuid() + net2['id'] = str(uuid.uuid4()) return [net1, net2] def create_port(self, tenant_id, network_id, subnet_id=None, @@ -142,7 +142,7 @@ class API(object): for i in range(2): ports.append(self.port.copy()) for port in ports: - port['id'] = uuidutils.generate_uuid() + port['id'] = str(uuid.uuid4()) for key, val in search_opts.items(): port[key] = val if 'id' in search_opts: @@ -177,8 +177,8 @@ class API(object): """Get all networks for client.""" net1 = self.network.copy() net2 = self.network.copy() - net1['id'] = uuidutils.generate_uuid() - net2['id'] = uuidutils.generate_uuid() + net1['id'] = str(uuid.uuid4()) + net2['id'] = str(uuid.uuid4()) return [net1, net2] def get_network(self, network_uuid):