cinder.scheduler.base_filter module

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: 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: Iterable, filter_properties: dict, index: int = 0) list

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.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.