diff options
| author | Yun Mao <yunmao@gmail.com> | 2012-08-25 10:34:58 -0400 |
|---|---|---|
| committer | Yun Mao <yunmao@gmail.com> | 2012-08-27 11:17:34 -0400 |
| commit | 3c176c3ffaef6fea32d9a8a6e271d2656bf47075 (patch) | |
| tree | 94b4dcb223e4bbcfd831000d7b3055ef1361ac64 | |
| parent | 5e012d8d45935b68a5ce5d50ed043d4bb8066cf8 (diff) | |
| download | nova-3c176c3ffaef6fea32d9a8a6e271d2656bf47075.tar.gz nova-3c176c3ffaef6fea32d9a8a6e271d2656bf47075.tar.xz nova-3c176c3ffaef6fea32d9a8a6e271d2656bf47075.zip | |
Correct live_migration rpc call in test
self.driver.compute_rpcapi.live_migration should be the correct
way to issue live_migration call instead of
compute_rpcapi.ComputeAPI.live_migration, because the ComputeAPI
is a class, not an instance of the class.
This technically does not matter because the method is moxed out
anyway for testing, but still it is confusing.
Partially fix bug 1037183
Change-Id: Id41520a44fb9cfc19e269427ee42493e5dc52f5b
| -rw-r--r-- | nova/tests/scheduler/test_scheduler.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py index bbb63ab51..c94b4a615 100644 --- a/nova/tests/scheduler/test_scheduler.py +++ b/nova/tests/scheduler/test_scheduler.py @@ -411,7 +411,8 @@ class SchedulerTestCase(test.TestCase): self.mox.StubOutWithMock(self.driver.compute_rpcapi, 'check_can_live_migrate_destination') self.mox.StubOutWithMock(db, 'instance_update_and_get_original') - self.mox.StubOutWithMock(compute_rpcapi.ComputeAPI, 'live_migration') + self.mox.StubOutWithMock(self.driver.compute_rpcapi, + 'live_migration') self.mox.StubOutWithMock(notifications, 'send_update') dest = 'fake_host2' @@ -433,8 +434,7 @@ class SchedulerTestCase(test.TestCase): (instance, instance)) notifications.send_update(self.context, instance, instance, service="scheduler") - - compute_rpcapi.ComputeAPI.live_migration(self.context, + self.driver.compute_rpcapi.live_migration(self.context, host=instance['host'], instance=instance, dest=dest, block_migration=block_migration, migrate_data={}) @@ -453,7 +453,8 @@ class SchedulerTestCase(test.TestCase): self.mox.StubOutWithMock(rpc, 'call') self.mox.StubOutWithMock(rpc, 'cast') self.mox.StubOutWithMock(db, 'instance_update_and_get_original') - self.mox.StubOutWithMock(compute_rpcapi.ComputeAPI, 'live_migration') + self.mox.StubOutWithMock(self.driver.compute_rpcapi, + 'live_migration') dest = 'fake_host2' block_migration = True @@ -500,7 +501,7 @@ class SchedulerTestCase(test.TestCase): {"task_state": task_states.MIGRATING}).AndReturn( (instance, instance)) - compute_rpcapi.ComputeAPI.live_migration(self.context, + self.driver.compute_rpcapi.live_migration(self.context, host=instance['host'], instance=instance, dest=dest, block_migration=block_migration, migrate_data={}) |
