From: Vincent Hou Date: Thu, 23 May 2013 11:54:36 +0000 (+0800) Subject: Add the service_state into test_schedule_happy_day. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=561520447de9b89db7f052e31fc9d5f7d416b5dc;p=openstack-build%2Fcinder-build.git Add the service_state into test_schedule_happy_day. Since the fake filter scheduler does not update the capabilities, the sevice states remains empty. To avoid the None value for free_capacity_gb, we set the host_manager to a fake host manager with a list of service states. Fixed Bug 1171906. Change-Id: I359ea6952392cc5e6b8eff513f3ca4d8161a30e3 --- diff --git a/cinder/tests/scheduler/test_filter_scheduler.py b/cinder/tests/scheduler/test_filter_scheduler.py index 05b9d1d80..f1e2b5bc9 100644 --- a/cinder/tests/scheduler/test_filter_scheduler.py +++ b/cinder/tests/scheduler/test_filter_scheduler.py @@ -96,6 +96,7 @@ class FilterSchedulerTestCase(test_scheduler.SchedulerTestCase): return [weights.WeighedHost(host_state, self.next_weight)] sched = fakes.FakeFilterScheduler() + sched.host_manager = fakes.FakeHostManager() fake_context = context.RequestContext('user', 'project', is_admin=True)