summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2013-05-31 20:04:52 +0000
committerChris Behrens <cbehrens@codestud.com>2013-05-31 20:21:17 +0000
commit8998cbe3cb89dcbdf0576693cac903d6e6441b6e (patch)
tree0243df87555bc4ec63678a0ccb6ce010afd01df3
parent9ca2673bef0d6a883df673fb6531640c8f268a44 (diff)
Remove unused launch_time from instance
'launch_time' is passed around as part of instance properties when an instance is being built, however it is not a column in the DB nor is it even used anywhere. It was also unnecessarily copied around in various tests. This patch removes all references to it. Change-Id: I2300cd6b8539d15bbcd35ab4c00ab99d4be13eb5
-rw-r--r--nova/compute/api.py3
-rw-r--r--nova/tests/compute/test_compute.py4
-rw-r--r--nova/tests/compute/test_compute_utils.py1
-rw-r--r--nova/tests/conductor/test_conductor.py1
-rw-r--r--nova/tests/console/test_console.py1
-rw-r--r--nova/tests/scheduler/fakes.py1
-rw-r--r--nova/tests/virt/hyperv/db_fakes.py2
-rw-r--r--nova/tests/virt/libvirt/test_libvirt.py1
-rw-r--r--nova/tests/virt/vmwareapi/db_fakes.py2
9 files changed, 1 insertions, 15 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 80c8074d9..a3ffb6fea 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -25,7 +25,6 @@ import base64
import functools
import re
import string
-import time
import uuid
from oslo.config import cfg
@@ -640,8 +639,6 @@ class API(base.Base):
'config_drive': config_drive or '',
'user_id': context.user_id,
'project_id': context.project_id,
- 'launch_time': time.strftime('%Y-%m-%dT%H:%M:%SZ',
- time.gmtime()),
'instance_type_id': instance_type['id'],
'memory_mb': instance_type['memory_mb'],
'vcpus': instance_type['vcpus'],
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 491ecf544..d94ca662e 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -238,7 +238,6 @@ class BaseTestCase(test.TestCase):
inst['vm_state'] = vm_states.ACTIVE
inst['image_ref'] = FAKE_IMAGE_REF
inst['reservation_id'] = 'r-fakeres'
- inst['launch_time'] = '10'
inst['user_id'] = self.user_id
inst['project_id'] = self.project_id
inst['host'] = 'fake_host'
@@ -1437,7 +1436,7 @@ class ComputeTestCase(BaseTestCase):
orig_sys_metadata=sys_metadata)
self.compute.terminate_instance(self.context, instance=instance)
- def test_rebuild_launch_time(self):
+ def test_rebuild_launched_at_time(self):
# Ensure instance can be rebuilt.
old_time = datetime.datetime(2012, 4, 1)
cur_time = datetime.datetime(2012, 12, 21, 12, 21)
@@ -7960,7 +7959,6 @@ class ComputeAPITestCase(BaseTestCase):
inst['vm_state'] = vm_states.ACTIVE
inst['image_ref'] = FAKE_IMAGE_REF
inst['reservation_id'] = 'r-fakeres'
- inst['launch_time'] = '10'
inst['user_id'] = self.user_id
inst['project_id'] = self.project_id
inst['host'] = 'fake_host'
diff --git a/nova/tests/compute/test_compute_utils.py b/nova/tests/compute/test_compute_utils.py
index 4366bf5ac..84dd67eb5 100644
--- a/nova/tests/compute/test_compute_utils.py
+++ b/nova/tests/compute/test_compute_utils.py
@@ -263,7 +263,6 @@ class UsageInfoTestCase(test.TestCase):
inst = {}
inst['image_ref'] = 1
inst['reservation_id'] = 'r-fakeres'
- inst['launch_time'] = '10'
inst['user_id'] = self.user_id
inst['project_id'] = self.project_id
inst['instance_type_id'] = instance_type['id']
diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py
index 28d0074f2..637596fc5 100644
--- a/nova/tests/conductor/test_conductor.py
+++ b/nova/tests/conductor/test_conductor.py
@@ -76,7 +76,6 @@ class _BaseTestCase(object):
inst['vm_state'] = vm_states.ACTIVE
inst['image_ref'] = FAKE_IMAGE_REF
inst['reservation_id'] = 'r-fakeres'
- inst['launch_time'] = '10'
inst['user_id'] = self.user_id
inst['project_id'] = self.project_id
inst['host'] = 'fake_host'
diff --git a/nova/tests/console/test_console.py b/nova/tests/console/test_console.py
index e4211f258..76a71936a 100644
--- a/nova/tests/console/test_console.py
+++ b/nova/tests/console/test_console.py
@@ -53,7 +53,6 @@ class ConsoleTestCase(test.TestCase):
#inst['name'] = 'instance-1234'
inst['image_id'] = 1
inst['reservation_id'] = 'r-fakeres'
- inst['launch_time'] = '10'
inst['user_id'] = self.user_id
inst['project_id'] = self.project_id
inst['instance_type_id'] = 1
diff --git a/nova/tests/scheduler/fakes.py b/nova/tests/scheduler/fakes.py
index 024d37969..c9157d11c 100644
--- a/nova/tests/scheduler/fakes.py
+++ b/nova/tests/scheduler/fakes.py
@@ -123,7 +123,6 @@ class FakeInstance(object):
inst['vm_state'] = vm_states.ACTIVE
inst['image_ref'] = 1
inst['reservation_id'] = 'r-fakeres'
- inst['launch_time'] = '10'
inst['user_id'] = 'fake'
inst['project_id'] = 'fake'
type_id = flavors.get_instance_type_by_name(type_name)['id']
diff --git a/nova/tests/virt/hyperv/db_fakes.py b/nova/tests/virt/hyperv/db_fakes.py
index 5152bd035..77f98d36c 100644
--- a/nova/tests/virt/hyperv/db_fakes.py
+++ b/nova/tests/virt/hyperv/db_fakes.py
@@ -18,7 +18,6 @@
Stubouts, mocks and fixtures for the test suite
"""
-import time
import uuid
from nova.compute import task_states
@@ -145,7 +144,6 @@ def stub_out_db_instance_api(stubs):
'task_state': task_states.SCHEDULING,
'user_id': values['user_id'],
'project_id': values['project_id'],
- 'launch_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()),
'instance_type': instance_type,
'memory_mb': instance_type['memory_mb'],
'vcpus': instance_type['vcpus'],
diff --git a/nova/tests/virt/libvirt/test_libvirt.py b/nova/tests/virt/libvirt/test_libvirt.py
index 6b70fe1c6..42060e784 100644
--- a/nova/tests/virt/libvirt/test_libvirt.py
+++ b/nova/tests/virt/libvirt/test_libvirt.py
@@ -4816,7 +4816,6 @@ class LibvirtDriverTestCase(test.TestCase):
inst = {}
inst['image_ref'] = '1'
inst['reservation_id'] = 'r-fakeres'
- inst['launch_time'] = '10'
inst['user_id'] = 'fake'
inst['project_id'] = 'fake'
type_id = flavors.get_instance_type_by_name('m1.tiny')['id']
diff --git a/nova/tests/virt/vmwareapi/db_fakes.py b/nova/tests/virt/vmwareapi/db_fakes.py
index 54e3cf43b..8f2df43e3 100644
--- a/nova/tests/virt/vmwareapi/db_fakes.py
+++ b/nova/tests/virt/vmwareapi/db_fakes.py
@@ -19,7 +19,6 @@
Stubouts, mocks and fixtures for the test suite
"""
-import time
import uuid
from nova.compute import task_states
@@ -72,7 +71,6 @@ def stub_out_db_instance_api(stubs):
'task_state': task_states.SCHEDULING,
'user_id': values['user_id'],
'project_id': values['project_id'],
- 'launch_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()),
'instance_type': values['instance_type'],
'memory_mb': type_data['memory_mb'],
'vcpus': type_data['vcpus'],