@@ -61,26 +61,15 @@ def submit_EBI(preprocessed_data_id, action, send):
6161 LogEntry .create ('Runtime' ,
6262 ("Submitting sequences for pre_processed_id: "
6363 "%d" % preprocessed_data_id ))
64- try :
65- for cmd in ebi_submission .generate_send_sequences_cmd ():
66- try :
67- stdout , stderr , _ = system_call (cmd )
68- except Exception as e :
69- stdout = ''
70- stderr = str (e )
71- le = LogEntry .create (
72- 'Fatal' , "Command: %s\n Error: %s\n " % (cmd ,
73- str (e )),
74- info = {'ebi_submission' : preprocessed_data_id })
75- ebi_submission .study .ebi_submission_status = (
76- "failed: ASCP submission, log id: %d" % le .id )
77- raise ComputeError ("EBI Submission failed! Log id: "
78- "%d" % le .id )
79- finally :
80- open (ebi_submission .ascp_reply , 'a' ).write (
81- 'stdout:\n %s\n \n stderr: %s' % (stdout , stderr ))
82- finally :
83- environ ['ASPERA_SCP_PASS' ] = old_ascp_pass
64+ for cmd in ebi_submission .generate_send_sequences_cmd ():
65+ stdout , stderr , rv = system_call (cmd )
66+ if rv != 0 :
67+ error_msg = ("Error:\n Std output:%s\n Std error:%s" % (
68+ stdout , stderr ))
69+ raise ComputeError (error_msg )
70+ open (ebi_submission .ascp_reply , 'a' ).write (
71+ 'stdout:\n %s\n \n stderr: %s' % (stdout , stderr ))
72+ environ ['ASPERA_SCP_PASS' ] = old_ascp_pass
8473 LogEntry .create ('Runtime' ,
8574 ('Submission of sequences of pre_processed_id: '
8675 '%d completed successfully' %
@@ -91,25 +80,18 @@ def submit_EBI(preprocessed_data_id, action, send):
9180 LogEntry .create ('Runtime' ,
9281 ("Submitting XMLs for pre_processed_id: "
9382 "%d" % preprocessed_data_id ))
94- try :
95- xml_content , stderr , _ = system_call (xmls_cmds )
96- except Exception as e :
97- xml_content = ''
98- stderr = str (e )
99- le = LogEntry .create (
100- 'Fatal' , "Command: %s\n Error: %s\n " % (cmd , str (e )),
101- info = {'ebi_submission' : preprocessed_data_id })
102- ebi_submission .study .ebi_submission_status = (
103- "failed: XML submission, log id: %d" % le .id )
104- raise ComputeError ("EBI Submission failed! Log id: %d" % le .id )
83+ xml_content , stderr , rv = system_call (xmls_cmds )
84+ if rv != 0 :
85+ error_msg = ("Error:\n Std output:%s\n Std error:%s" % (
86+ xml_content , stderr ))
87+ raise ComputeError (error_msg )
10588 else :
10689 LogEntry .create ('Runtime' ,
10790 ('Submission of sequences of pre_processed_id: '
10891 '%d completed successfully' %
10992 preprocessed_data_id ))
110- finally :
111- open (ebi_submission .curl_reply , 'w' ).write (
112- 'stdout:\n %s\n \n stderr: %s' % (xml_content , stderr ))
93+ open (ebi_submission .curl_reply , 'w' ).write (
94+ 'stdout:\n %s\n \n stderr: %s' % (xml_content , stderr ))
11395
11496 try :
11597 st_acc , sa_acc , bio_acc , ex_acc , run_acc = \
@@ -198,7 +180,10 @@ def submit_VAMPS(artifact_id):
198180 qiita_config .vamps_pass ,
199181 targz_fp ,
200182 qiita_config .vamps_url ))
201- obs , _ , _ = system_call (cmd )
183+ obs , stderr , rv = system_call (cmd )
184+ if rv != 0 :
185+ error_msg = ("Error:\n Std output:%s\n Std error:%s" % (obs , stderr ))
186+ raise ComputeError (error_msg )
202187
203188 exp = ("<html>\n <head>\n <title>Process Uploaded File</title>\n </head>\n "
204189 "<body>\n </body>\n </html>" )
0 commit comments