Example #1
0
def all_weighers():
    """Return a list of weight plugin classes found in this directory."""

    if (CONF.least_cost_functions is not None or
            CONF.compute_fill_first_cost_fn_weight is not None):
        LOG.deprecated(_('least_cost has been deprecated in favor of '
                'the RAM Weigher.'))
        return least_cost.get_least_cost_weighers()
    return HostWeightHandler().get_all_classes()
Example #2
0
def all_weighers():
    """Return a list of weight plugin classes found in this directory."""

    if (CONF.least_cost_functions is not None or
            CONF.compute_fill_first_cost_fn_weight is not None):
        LOG.deprecated(_('least_cost has been deprecated in favor of '
                'the RAM Weigher.'))
        return least_cost.get_least_cost_weighers()
    return HostWeightHandler().get_all_classes()
Example #3
0
 def _get_weighed_host(self, hosts, weight_properties=None):
     weigher_classes = least_cost.get_least_cost_weighers()
     if weight_properties is None:
         weight_properties = {}
     return self.weight_handler.get_weighed_objects(weigher_classes,
             hosts, weight_properties)[0]
 def _get_weighed_host(self, hosts, weight_properties=None):
     weigher_classes = least_cost.get_least_cost_weighers()
     if weight_properties is None:
         weight_properties = {}
     return self.weight_handler.get_weighed_objects(weigher_classes, hosts,
                                                    weight_properties)[0]