Replaces uuid.uuid4 with uuidutils.generate_uuid()

Change-Id: Icbbb58cd5d84e5c9f382b13beb83efc9c94cf67c
This commit is contained in:
Kiran_totad 2017-07-25 11:14:01 +05:30
parent 35102c0777
commit 563f700b62

View File

@ -15,8 +15,8 @@
import copy import copy
from oslo_utils import timeutils from oslo_utils import timeutils
from oslo_utils import uuidutils
import testtools import testtools
import uuid
from tricircleclient.tests.unit import fakes from tricircleclient.tests.unit import fakes
@ -71,7 +71,7 @@ class FakePod(object):
'pod': { 'pod': {
'dc_name': 'datacenter', 'dc_name': 'datacenter',
'pod_az_name': 'pod', 'pod_az_name': 'pod',
'pod_id': uuid.uuid4().hex, 'pod_id': uuidutils.generate_uuid(),
'az_name': 'availability_zone', 'az_name': 'availability_zone',
'region_name': 'central_region', 'region_name': 'central_region',
} }
@ -109,12 +109,12 @@ class FakeRouting(object):
# Set default options. # Set default options.
fake_routing = { fake_routing = {
'routing': { 'routing': {
'top_id': uuid.uuid4().hex, 'top_id': uuidutils.generate_uuid(),
'bottom_id': uuid.uuid4().hex, 'bottom_id': uuidutils.generate_uuid(),
'pod_id': uuid.uuid4().hex, 'pod_id': uuidutils.generate_uuid(),
'project_id': uuid.uuid4().hex, 'project_id': uuidutils.generate_uuid(),
'resource_type': 'network', 'resource_type': 'network',
'id': uuid.uuid4().hex, 'id': uuidutils.generate_uuid(),
'created_at': str(timeutils.utcnow()), 'created_at': str(timeutils.utcnow()),
'updated_at': str(timeutils.utcnow()), 'updated_at': str(timeutils.utcnow()),
} }
@ -155,14 +155,14 @@ class FakeJob(object):
# Set default options. # Set default options.
fake_job = { fake_job = {
'job': { 'job': {
'id': uuid.uuid4().hex, 'id': uuidutils.generate_uuid(),
'type': 'router_setup', 'type': 'router_setup',
'resource': { 'resource': {
'pod_id': uuid.uuid4().hex, 'pod_id': uuidutils.generate_uuid(),
'router_id': uuid.uuid4().hex, 'router_id': uuidutils.generate_uuid(),
'network_id': uuid.uuid4().hex, 'network_id': uuidutils.generate_uuid(),
}, },
'project_id': uuid.uuid4().hex, 'project_id': uuidutils.generate_uuid(),
'status': 'NEW', 'status': 'NEW',
'timestamp': str(timeutils.utcnow()), 'timestamp': str(timeutils.utcnow()),
} }