def test_execute_without_destination(self):
    self.destination = None
    self._generate_task()
    self.assertIsNone(self.task.destination)
    self.mox.StubOutWithMock(self.task, '_check_host_is_up')
    self.mox.StubOutWithMock(self.task, '_find_destination')
    self.mox.StubOutWithMock(self.task.compute_rpcapi, 'live_migration')
    self.task._check_host_is_up(self.instance_host)
    self.task._find_destination().AndReturn('found_host')
    self.task.compute_rpcapi.live_migration(self.context, host=self.instance_host, instance=self.instance, dest='found_host', block_migration=self.block_migration, migrate_data=None).AndReturn('bob')
    self.mox.ReplayAll()
    self.assertEqual('bob', self.task.execute())
def test_execute_without_destination(self):
    self.destination = None
    self._generate_task()
    self.assertIsNone(self.task.destination)
    self.mox.StubOutWithMock(self.task, '_check_host_is_up')
    self.mox.StubOutWithMock(self.task, '_find_destination')
    self.mox.StubOutWithMock(self.task.compute_rpcapi, 'live_migration')
    self.task._check_host_is_up(self.instance_host)
    self.task._find_destination().AndReturn('found_host')
    self.task.compute_rpcapi.live_migration(self.context, host=self.instance_host, instance=self.instance, dest='found_host', block_migration=self.block_migration, migrate_data=None).AndReturn('bob')
    self.mox.ReplayAll()
    self.assertEqual('bob', self.task.execute())