'Since the caller may specify which filters to use we need
to have an authoritative list of what is permissible. This
function checks the filter names against a predefined set
of acceptable filters.'

def _choose_host_filters(self, filter_cls_names):

    if (not isinstance(filter_cls_names, (list, tuple))):
        filter_cls_names = [filter_cls_names]
    good_filters = []
    bad_filters = []
    for filter_name in filter_cls_names:
        if (filter_name not in self.filter_obj_map):
            if (filter_name not in self.filter_cls_map):
                bad_filters.append(filter_name)
                continue
            filter_cls = self.filter_cls_map[filter_name]
            self.filter_obj_map[filter_name] = filter_cls()
        good_filters.append(self.filter_obj_map[filter_name])
    if bad_filters:
        msg = ',    '.join(bad_filters)
        raise exception.SchedulerHostFilterNotFound(filter_name=msg)
    return good_filters
