#NEWLINE# def _get_count( self , allocator , resource_desc , credentials ) : #NEWLINE# #INDENT# ' Get `max_servers` from an allocator. ' #NEWLINE# set_credentials ( credentials ) #NEWLINE# count = 0 #NEWLINE# adjusted = ( self . _method == 'load-average' ) #NEWLINE# try : #NEWLINE# #INDENT# ( count , criteria ) = allocator . max_servers ( resource_desc , load_adjusted = adjusted ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# msg = traceback . format_exc ( ) #NEWLINE# self . _logger . error ( '%r max_servers() caught exception %s' , allocator . name , msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( count < 1 ) : #NEWLINE# #INDENT# self . _logger . debug ( '%s incompatible: %s' , allocator . name , criteria ) #NEWLINE# #UNINDENT# #UNINDENT# return max ( count , 0 )