~blamar/nova/gracefull-shutdown

« back to all changes in this revision

Viewing changes to nova/scheduler/host_filter.py

compute_api.get_all should be able to recurse zones (bug 744217).
Also, allow to build more than one instance at once with zone_aware_scheduler types.
Other cleanups with regards to zone aware scheduler...
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
329
329
                    'instance_type': <InstanceType dict>}
330
330
    """
331
331
 
332
 
    def filter_hosts(self, num, request_spec):
 
332
    def filter_hosts(self, topic, request_spec, hosts=None):
333
333
        """Filter the full host list (from the ZoneManager)"""
 
334
 
334
335
        filter_name = request_spec.get('filter', None)
335
336
        host_filter = choose_host_filter(filter_name)
336
337
 
341
342
        name, query = host_filter.instance_type_to_filter(instance_type)
342
343
        return host_filter.filter_hosts(self.zone_manager, query)
343
344
 
344
 
    def weigh_hosts(self, num, request_spec, hosts):
 
345
    def weigh_hosts(self, topic, request_spec, hosts):
345
346
        """Derived classes must override this method and return
346
347
        a lists of hosts in [{weight, hostname}] format.
347
348
        """
348
 
        return [dict(weight=1, hostname=host) for host, caps in hosts]
 
349
        return [dict(weight=1, hostname=hostname, capabilities=caps)
 
350
                for hostname, caps in hosts]