The cinder.scheduler.base_filter Module

Filter support

class BaseFilter

Bases: object

Base class for all filter classes.

filter_all(filter_obj_list, filter_properties)

Yield objects that pass the filter.

Can be overridden in a subclass, if you need to base filtering decisions on all objects. Otherwise, one can just override _filter_one() to filter a single object.

run_filter_for_index(index)

Return True if the filter needs to be run for n-th instances.

Only need to override this if a filter needs anything other than “first only” or “all” behaviour.

run_filter_once_per_request = False
class BaseFilterHandler(modifier_class_type, modifier_namespace)

Bases: cinder.scheduler.base_handler.BaseHandler

Base class to handle loading filter classes.

This class should be subclassed where one needs to use filters.

get_filtered_objects(filter_classes, objs, filter_properties, index=0)

Get objects after filter

Parameters:
  • filter_classes – filters that will be used to filter the objects
  • objs – objects that will be filtered
  • filter_properties – client filter properties
  • index – This value needs to be increased in the caller function of get_filtered_objects when handling each resource.