]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add the service_state into test_schedule_happy_day.
authorVincent Hou <sbhou@cn.ibm.com>
Thu, 23 May 2013 11:54:36 +0000 (19:54 +0800)
committerVincent Hou <sbhou@cn.ibm.com>
Thu, 23 May 2013 12:38:14 +0000 (20:38 +0800)
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

cinder/tests/scheduler/test_filter_scheduler.py

index 05b9d1d809c2c8431a32e974adf3f6397e0fc6a0..f1e2b5bc9b6c455501461a0315b20e257ed8d5c7 100644 (file)
@@ -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)