is the name of the filter class.
"""
name = 'cells_scheduler_filter:' + self.__class__.__name__
target = {'project_id': ctxt.project_id,
'user_id': ctxt.user_id}
return policy.enforce(ctxt, name, target, do_raise=False)
**** CubicPower OpenStack Study ****
def _filter_one(self, cell, filter_properties):
return self.cell_passes(cell, filter_properties)
**** CubicPower OpenStack Study ****
def cell_passes(self, cell, filter_properties):
"""Return True if the CellState passes the filter, otherwise False.
Override this in a subclass.
"""
raise NotImplementedError()
**** CubicPower OpenStack Study ****
class CellFilterHandler(filters.BaseFilterHandler):
**** CubicPower OpenStack Study ****
def __init__(self):
super(CellFilterHandler, self).__init__(BaseCellFilter)
def all_filters():
"""Return a list of filter classes found in this directory.
This method is used as the default for available scheduler filters
and should return a list of all filter classes available.
"""
return CellFilterHandler().get_all_classes()
**** CubicPower OpenStack Study ****
def all_filters():
"""Return a list of filter classes found in this directory.
This method is used as the default for available scheduler filters
and should return a list of all filter classes available.
"""
return CellFilterHandler().get_all_classes()