'Return a list of backends that meet required specs.
Returned list is ordered by their fitness.'

def _get_weighted_candidates(self, context, request_spec, filter_properties=None):

    elevated = context.elevated()
    volume_type = request_spec.get('volume_type')
    resource_type = (volume_type if (volume_type is not None) else {})
    config_options = self._get_configuration_options()
    if (filter_properties is None):
        filter_properties = {}
    self._populate_retry(filter_properties, request_spec['volume_properties'])
    request_spec_dict = jsonutils.to_primitive(request_spec)
    filter_properties.update({'context': context, 'request_spec': request_spec_dict, 'config_options': config_options, 'volume_type': volume_type, 'resource_type': resource_type})
    self.populate_filter_properties(request_spec, filter_properties)
    multiattach = request_spec['volume_properties'].get('multiattach', False)
    if (multiattach and ('multiattach' not in resource_type.get('extra_specs', {}))):
        if ('extra_specs' not in resource_type):
            resource_type['extra_specs'] = {}
        resource_type['extra_specs'].update(multiattach='<is>    True')
    backends = self.host_manager.get_all_backend_states(elevated)
    backends = self.host_manager.get_filtered_backends(backends, filter_properties)
    if (not backends):
        return []
    LOG.debug('Filtered    %s', backends)
    weighed_backends = self.host_manager.get_weighed_backends(backends, filter_properties)
    return weighed_backends
