#NEWLINE# def get_service_job_task_attribute( args , cluster , jobs , parsing_service , current_job , host_id , instance_id , val ) : #NEWLINE# #INDENT# reg_expr = SERVICE_JOB_TASK_ATTRIBUTE_REGEX . match ( val ) #NEWLINE# service = reg_expr . group ( 'service' ) #NEWLINE# job_name = reg_expr . group ( 'job' ) #NEWLINE# task_id = reg_expr . group ( 'task' ) #NEWLINE# attribute = reg_expr . group ( 'attribute' ) #NEWLINE# service_config = get_service_config ( args , service , cluster ) #NEWLINE# ( host_id , instance_id ) = parse_task_number ( task_id , service_config . jobs [ job_name ] . hosts ) #NEWLINE# if ( attribute == 'host' ) : #NEWLINE# #INDENT# return service_config . jobs [ job_name ] . hosts [ host_id ] . ip #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( attribute == 'base_port' ) : #NEWLINE# #INDENT# return get_base_port ( service_config . jobs [ job_name ] . base_port , args )