diff options
| author | Zhongyue Luo <zhongyue.nah@intel.com> | 2012-11-14 18:25:59 +0800 |
|---|---|---|
| committer | Zhongyue Luo <zhongyue.nah@intel.com> | 2012-11-14 22:16:24 +0900 |
| commit | 5beeed884753c3fb196cb66684d761dfc424b0db (patch) | |
| tree | 38a884a4507fc07d7ed10269fe1c9a23a1d1afd1 /nova/compute | |
| parent | 6375ca7eb56b13bb4794b843a5eaef8118f0dff6 (diff) | |
Remove gen_uuid()
Removed gen_uuid and uuid related unittests
Replaced utils.gen_uuid() with uuid.uuid4()
Change-Id: I3020a0d67525eb73cfb8873d2570c93e2022bb76
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 3 | ||||
| -rw-r--r-- | nova/compute/instance_types.py | 3 | ||||
| -rw-r--r-- | nova/compute/manager.py | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 092ea6b39..5a8bcad2f 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -27,6 +27,7 @@ import re import string import time import urllib +import uuid from nova import block_device from nova.compute import instance_types @@ -678,7 +679,7 @@ class API(base.Base): if not instance.get('uuid'): # Generate the instance_uuid here so we can use it # for additional setup before creating the DB entry. - instance['uuid'] = str(utils.gen_uuid()) + instance['uuid'] = str(uuid.uuid4()) instance['launch_index'] = 0 instance['vm_state'] = vm_states.BUILDING diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py index 5efa3d97c..4be4ab71d 100644 --- a/nova/compute/instance_types.py +++ b/nova/compute/instance_types.py @@ -21,6 +21,7 @@ """Built-in instance properties.""" import re +import uuid from nova import config from nova import context @@ -41,7 +42,7 @@ def create(name, memory, vcpus, root_gb, ephemeral_gb=None, flavorid=None, """Creates instance types.""" if flavorid is None: - flavorid = utils.gen_uuid() + flavorid = uuid.uuid4() if swap is None: swap = 0 if rxtx_factor is None: diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 9011196b2..be20c7a40 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -40,6 +40,7 @@ import socket import sys import time import traceback +import uuid from eventlet import greenthread @@ -2180,7 +2181,7 @@ class ComputeManager(manager.SchedulerDependentManager): """Return connection information for a vnc console.""" context = context.elevated() LOG.debug(_("Getting vnc console"), instance=instance) - token = str(utils.gen_uuid()) + token = str(uuid.uuid4()) if console_type == 'novnc': # For essex, novncproxy_base_url must include the full path |
