#NEWLINE# def job_execution_requires_proxy_user( job_execution ) : #NEWLINE# #INDENT# 'Returns True if the job execution requires a proxy user.' #NEWLINE# def _check_values( values ) : #NEWLINE# #INDENT# return any ( ( value . startswith ( su . SWIFT_INTERNAL_PREFIX ) for value in values if isinstance ( value , six . string_types ) ) ) #NEWLINE# #UNINDENT# if ( CONF . use_domain_for_proxy_users is False ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# paths = [ conductor . data_source_get ( context . ctx ( ) , job_execution . output_id ) , conductor . data_source_get ( context . ctx ( ) , job_execution . input_id ) ] #NEWLINE# if _check_values ( ( ds . url for ds in paths if ds ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if _check_values ( six . itervalues ( job_execution . job_configs . get ( 'configs' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if _check_values ( six . itervalues ( job_execution . job_configs . get ( 'params' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if _check_values ( job_execution . job_configs . get ( 'args' , [ ] ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# job = conductor . job_get ( context . ctx ( ) , names . job_id ) #NEWLINE# if _check_values ( ( main . url for main in job . mains ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if _check_values ( ( lib . url for lib in job . libs ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# ( by_name , by_uuid ) = job_utils . may_contain_data_source_refs ( job_execution . job_configs ) #NEWLINE# if by_name : #NEWLINE# #INDENT# names = tuple ( job_utils . find_possible_data_source_refs_by_name ( job_execution . job_configs ) ) #NEWLINE# if ( names and ( conductor . data_source_count ( context . ctx ( ) , name = names , url = ( su . SWIFT_INTERNAL_PREFIX + '%' ) ) > 0 ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# if by_uuid : #NEWLINE# #INDENT# uuids = tuple ( job_utils . find_possible_data_source_refs_by_uuid ( job_execution . job_configs ) ) #NEWLINE# if ( uuids and ( conductor . data_source_count ( context . ctx ( ) , id = uuids , url = ( su . SWIFT_INTERNAL_PREFIX + '%' ) ) > 0 ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# return False