Merge "Remove unused time keyword arg"

This commit is contained in:
Jenkins 2012-04-24 16:27:09 +00:00 committed by Gerrit Code Review
commit 2c786ff3ad
2 changed files with 3 additions and 13 deletions

View File

@ -1881,7 +1881,7 @@ class ComputeManager(manager.SchedulerDependentManager):
"""
return self.driver.get_instance_disk_info(instance_name)
def pre_live_migration(self, context, instance_id, time=None,
def pre_live_migration(self, context, instance_id,
block_migration=False, disk=None):
"""Preparations for live migration at dest host.
@ -1890,9 +1890,6 @@ class ComputeManager(manager.SchedulerDependentManager):
:param block_migration: if true, prepare for block migration
"""
if not time:
time = greenthread
# Getting instance info
instance_ref = self.db.instance_get(context, instance_id)

View File

@ -58,14 +58,6 @@ flags.DECLARE('stub_network', 'nova.compute.manager')
flags.DECLARE('live_migration_retry_count', 'nova.compute.manager')
class FakeTime(object):
def __init__(self):
self.counter = 0
def sleep(self, t):
self.counter += t
orig_rpc_call = rpc.call
orig_rpc_cast = rpc.cast
@ -1244,9 +1236,10 @@ class ComputeTestCase(BaseTestCase):
c = context.get_admin_context()
# start test
self.stubs.Set(time, 'sleep', lambda t: None)
self.assertRaises(exception.FixedIpNotFoundForInstance,
self.compute.pre_live_migration,
c, inst_ref['id'], time=FakeTime())
c, inst_ref['id'])
# cleanup
db.instance_destroy(c, inst_ref['id'])