#NEWLINE# def _check_local( self , resource_desc ) : #NEWLINE# #INDENT# ' Check locally-relevant resources. ' #NEWLINE# rdesc = resource_desc . copy ( ) #NEWLINE# for key in ( 'localhost' , 'allocator' ) : #NEWLINE# #INDENT# if ( key not in rdesc ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# value = rdesc [ key ] #NEWLINE# if ( key == 'localhost' ) : #NEWLINE# #INDENT# if value : #NEWLINE# #INDENT# return ( None , ( ( - 2 ) , { #NEWLINE# #INDENT# key : 'requested local host' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'allocator' ) : #NEWLINE# #INDENT# if ( value != self . name ) : #NEWLINE# #INDENT# return ( None , ( ( - 2 ) , { #NEWLINE# #INDENT# key : 'wrong allocator' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# del rdesc [ key ] #NEWLINE# #UNINDENT# return ( rdesc , None )