예제 #1
0
 def __init__(self):
     self.service_states = {}  # { <host>: {<service>: {cap k : v}}}
     self.host_state_map = {}
     self.filter_handler = base_host_filter.HostFilterHandler(
         'manila.scheduler.filters')
     self.filter_classes = self.filter_handler.get_all_classes()
     self.weight_handler = base_host_weigher.HostWeightHandler(
         'manila.scheduler.weighers')
     self.weight_classes = self.weight_handler.get_all_classes()
예제 #2
0
 def setUp(self):
     super(HostFiltersTestCase, self).setUp()
     self.json_query = jsonutils.dumps([
         'and', ['>=', '$free_ram_mb', 1024],
         ['>=', '$free_disk_mb', 200 * 1024]
     ])
     namespace = 'manila.scheduler.filters'
     filter_handler = base_host.HostFilterHandler(namespace)
     classes = filter_handler.get_all_classes()
     self.class_map = {}
     for cls in classes:
         self.class_map[cls.__name__] = cls