@@ -61,26 +61,19 @@ def submit_EBI(preprocessed_data_id, action, send):
61
61
LogEntry .create ('Runtime' ,
62
62
("Submitting sequences for pre_processed_id: "
63
63
"%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
+ le = LogEntry .create (
68
+ 'Fatal' , "Command: %s\n Error: %s\n " % (cmd , stderr ),
69
+ info = {'ebi_submission' : preprocessed_data_id })
70
+ ebi_submission .study .ebi_submission_status = (
71
+ "failed: ASCP submission, log id: %d" % le .id )
72
+ raise ComputeError ("EBI Submission failed! Log id: "
73
+ "%d" % le .id )
74
+ open (ebi_submission .ascp_reply , 'a' ).write (
75
+ 'stdout:\n %s\n \n stderr: %s' % (stdout , stderr ))
76
+ environ ['ASPERA_SCP_PASS' ] = old_ascp_pass
84
77
LogEntry .create ('Runtime' ,
85
78
('Submission of sequences of pre_processed_id: '
86
79
'%d completed successfully' %
@@ -91,13 +84,11 @@ def submit_EBI(preprocessed_data_id, action, send):
91
84
LogEntry .create ('Runtime' ,
92
85
("Submitting XMLs for pre_processed_id: "
93
86
"%d" % preprocessed_data_id ))
94
- try :
95
- xml_content , stderr , _ = system_call (xmls_cmds )
96
- except Exception as e :
87
+ xml_content , stderr , rv = system_call (xmls_cmds )
88
+ if rv != 0 :
97
89
xml_content = ''
98
- stderr = str (e )
99
90
le = LogEntry .create (
100
- 'Fatal' , "Command: %s\n Error: %s\n " % (cmd , str ( e ) ),
91
+ 'Fatal' , "Command: %s\n Error: %s\n " % (cmd , stderr ),
101
92
info = {'ebi_submission' : preprocessed_data_id })
102
93
ebi_submission .study .ebi_submission_status = (
103
94
"failed: XML submission, log id: %d" % le .id )
@@ -107,9 +98,8 @@ def submit_EBI(preprocessed_data_id, action, send):
107
98
('Submission of sequences of pre_processed_id: '
108
99
'%d completed successfully' %
109
100
preprocessed_data_id ))
110
- finally :
111
- open (ebi_submission .curl_reply , 'w' ).write (
112
- 'stdout:\n %s\n \n stderr: %s' % (xml_content , stderr ))
101
+ open (ebi_submission .curl_reply , 'w' ).write (
102
+ 'stdout:\n %s\n \n stderr: %s' % (xml_content , stderr ))
113
103
114
104
try :
115
105
st_acc , sa_acc , bio_acc , ex_acc , run_acc = \
@@ -198,7 +188,9 @@ def submit_VAMPS(artifact_id):
198
188
qiita_config .vamps_pass ,
199
189
targz_fp ,
200
190
qiita_config .vamps_url ))
201
- obs , _ , _ = system_call (cmd )
191
+ obs , stderr , rv = system_call (cmd )
192
+ if rv != 0 :
193
+ raise ComputeError ('Error: \n stderr: %s' % stderr )
202
194
203
195
exp = ("<html>\n <head>\n <title>Process Uploaded File</title>\n </head>\n "
204
196
"<body>\n </body>\n </html>" )
0 commit comments