Get rid of pylint E0203 in filter_scheduler.py
by refactoring Change-Id: I0b39293e7a7bb2154a6121ea8cdda8454dff2184
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user