#NEWLINE# def check_compatibility( self , resource_desc ) : #NEWLINE# #INDENT# '\n        Check compatibility with common resource attributes.\n\n        resource_desc: dict\n            Description of required resources.\n\n        Returns ``(retcode, info)``.  If `retcode` is zero, then `info`\n        is a list of keys in `recource_desc` that have not been processed.\n        Otherwise, `retcode` will be -2 and `info` will be a single-entry\n        dictionary whose key is the incompatible key in `resource_desc`\n        and whose value provides data regarding the incompatibility.\n        ' #NEWLINE# keys = [ ] #NEWLINE# for ( key , value ) in resource_desc . items ( ) : #NEWLINE# #INDENT# if ( key in QUEUING_SYSTEM_KEYS ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'required_distributions' ) : #NEWLINE# #INDENT# missing = self . check_required_distributions ( value ) #NEWLINE# if missing : #NEWLINE# #INDENT# return ( ( - 2 ) , { #NEWLINE# #INDENT# key : ( 'missing %s' % missing ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( sys_ver == 'orphan_modules' ) : #NEWLINE# #INDENT# missing = self . check_orphan_modules ( value ) #NEWLINE# if missing : #NEWLINE# #INDENT# return ( ( - 2 ) , { #NEWLINE# #INDENT# key : ( 'missing %s' % missing ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'python_version' ) : #NEWLINE# #INDENT# req_ver = float ( value ) #NEWLINE# sys_ver = float ( sys . version [ : 3 ] ) #NEWLINE# if ( ( int ( sys_ver ) != int ( req_ver ) ) or ( sys_ver < req_ver ) ) : #NEWLINE# #INDENT# return ( ( - 2 ) , { #NEWLINE# #INDENT# key : ( 'want %s, have %s' % ( req_ver , sys_ver ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'exclude' ) : #NEWLINE# #INDENT# if ( socket . gethostname ( ) in value ) : #NEWLINE# #INDENT# return ( ( - 2 ) , { #NEWLINE# #INDENT# key : ( 'excluded host %s' % socket . gethostname ( ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'allocator' ) : #NEWLINE# #INDENT# if ( self . name != value ) : #NEWLINE# #INDENT# return ( ( - 2 ) , { #NEWLINE# #INDENT# key : 'wrong allocator' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# keys . append ( key ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return ( 0 , keys )