Ejemplo n.º 1
0
 def __init__(self):
     self.service_states = {}  # { <host>: {<service>: {cap k : v}}}
     self.host_state_map = {}
     self.filter_handler = filters.HostFilterHandler('manila.scheduler.'
                                                     'filters')
     self.filter_classes = self.filter_handler.get_all_classes()
     self.weight_handler = weights.HostWeightHandler('manila.scheduler.'
                                                     'weights')
     self.weight_classes = self.weight_handler.get_all_classes()
Ejemplo n.º 2
0
 def setUp(self):
     super(HostFiltersTestCase, self).setUp()
     self.context = context.RequestContext('fake', 'fake')
     self.json_query = jsonutils.dumps([
         'and', ['>=', '$free_capacity_gb', 1024],
         ['>=', '$total_capacity_gb', 10 * 1024]
     ])
     # This has a side effect of testing 'get_filter_classes'
     # when specifying a method (in this case, our standard filters)
     filter_handler = filters.HostFilterHandler('manila.scheduler.filters')
     classes = filter_handler.get_all_classes()
     self.class_map = {}
     for cls in classes:
         self.class_map[cls.__name__] = cls