#NEWLINE# def _schedule( self , context , request_spec , filter_properties ) : #NEWLINE# #INDENT# 'Returns a list of hosts that meet the required specs,\n        ordered by their fitness.\n        ' #NEWLINE# instance_type = request_spec . get ( 'instance_type' , None ) #NEWLINE# instance_uuids = request_spec . get ( 'instance_uuids' , None ) #NEWLINE# config_options = self . _get_configuration_options ( ) #NEWLINE# if instance_uuids : #NEWLINE# #INDENT# num_instances = len ( instance_uuids ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# num_instances = request_spec . get ( 'num_instances' , 1 ) #NEWLINE# #UNINDENT# solver_cache = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# filter_properties . update ( { #NEWLINE# #INDENT# 'context' : context , #NEWLINE# 'request_spec' : request_spec , #NEWLINE# 'config_options' : config_options , #NEWLINE# 'instance_type' : instance_type , #NEWLINE# 'num_instances' : num_instances , #NEWLINE# 'instance_uuids' : instance_uuids , #NEWLINE# 'solver_cache' : solver_cache , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . populate_filter_properties ( request_spec , filter_properties ) #NEWLINE# selected_hosts = self . _get_selected_hosts ( context , filter_properties ) #NEWLINE# filter_properties . pop ( 'solver_cache' ) #NEWLINE# return selected_hosts