diff options
| author | Arata Notsu <notsu@virtualtech.jp> | 2012-11-10 11:11:45 +0900 |
|---|---|---|
| committer | Arata Notsu <notsu@virtualtech.jp> | 2012-11-10 11:14:07 +0900 |
| commit | d993d947c7d8310a53c285cc7ea44cd4d8a06162 (patch) | |
| tree | 8a3125bba1bbf371ee6f41b23f99cb8df6200e52 /nova | |
| parent | 910a5487352dc0d36a4520f5b2787ec2290d965f (diff) | |
| download | nova-d993d947c7d8310a53c285cc7ea44cd4d8a06162.tar.gz nova-d993d947c7d8310a53c285cc7ea44cd4d8a06162.tar.xz nova-d993d947c7d8310a53c285cc7ea44cd4d8a06162.zip | |
Get rid of pylint E0203 in filter_scheduler.py
by refactoring
Change-Id: I0b39293e7a7bb2154a6121ea8cdda8454dff2184
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/scheduler/filter_scheduler.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/scheduler/filter_scheduler.py b/nova/scheduler/filter_scheduler.py index 776797d68..2522109a7 100644 --- a/nova/scheduler/filter_scheduler.py +++ b/nova/scheduler/filter_scheduler.py @@ -39,6 +39,7 @@ class FilterScheduler(driver.Scheduler): """Scheduler that can be used for filtering and weighing.""" def __init__(self, *args, **kwargs): super(FilterScheduler, self).__init__(*args, **kwargs) + self.cost_function_cache = None self.options = scheduler_options.SchedulerOptions() def schedule_run_instance(self, context, request_spec, @@ -294,7 +295,7 @@ class FilterScheduler(driver.Scheduler): """Returns a list of tuples containing weights and cost functions to use for weighing hosts """ - if getattr(self, 'cost_function_cache', None) is not None: + if self.cost_function_cache is not None: return self.cost_function_cache cost_fns = [] |
