#NEWLINE# def _get_selected_hosts( self , context , filter_properties ) : #NEWLINE# #INDENT# 'Returns the list of hosts that meet the required specs for\n        each instance in the list of instance_uuids.\n         Here each instance in instance_uuids have the same requirement\n         as specified by request_spec.\n        ' #NEWLINE# elevated = context . elevated ( ) #NEWLINE# hosts = self . _get_all_host_states ( elevated ) #NEWLINE# selected_hosts = [ ] #NEWLINE# hosts = self . host_manager . get_hosts_stripping_ignored_and_forced ( hosts , filter_properties ) #NEWLINE# list_hosts = list ( hosts ) #NEWLINE# LOG . debug ( 'host state list: %(hoststates)s' , { #NEWLINE# #INDENT# 'hoststates' : list_hosts , #NEWLINE# #UNINDENT# } ) #NEWLINE# LOG . debug ( 'filter properties given to solver: %(prop)s' , { #NEWLINE# #INDENT# 'prop' : filter_properties , #NEWLINE# #UNINDENT# } ) #NEWLINE# host_instance_combinations = self . hosts_solver . solve ( list_hosts , filter_properties ) #NEWLINE# LOG . debug ( 'solver results: %(host_instance_tuples_list)s' , { #NEWLINE# #INDENT# 'host_instance_tuples_list' : host_instance_combinations , #NEWLINE# #UNINDENT# } ) #NEWLINE# selected_hosts = [ weights . WeighedHost ( host , 1 ) for ( host , instance ) in host_instance_combinations ] #NEWLINE# return selected_hosts