Skip to content

Partial #2237 #2368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 23, 2017
Next Next commit
fix calls to system_call and ebi submissions
  • Loading branch information
antgonza committed Oct 12, 2017
commit cc97e89cedb601473c2881463cd7fc6974233131
50 changes: 21 additions & 29 deletions qiita_ware/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,19 @@ def submit_EBI(preprocessed_data_id, action, send):
LogEntry.create('Runtime',
("Submitting sequences for pre_processed_id: "
"%d" % preprocessed_data_id))
try:
for cmd in ebi_submission.generate_send_sequences_cmd():
try:
stdout, stderr, _ = system_call(cmd)
except Exception as e:
stdout = ''
stderr = str(e)
le = LogEntry.create(
'Fatal', "Command: %s\nError: %s\n" % (cmd,
str(e)),
info={'ebi_submission': preprocessed_data_id})
ebi_submission.study.ebi_submission_status = (
"failed: ASCP submission, log id: %d" % le.id)
raise ComputeError("EBI Submission failed! Log id: "
"%d" % le.id)
finally:
open(ebi_submission.ascp_reply, 'a').write(
'stdout:\n%s\n\nstderr: %s' % (stdout, stderr))
finally:
environ['ASPERA_SCP_PASS'] = old_ascp_pass
for cmd in ebi_submission.generate_send_sequences_cmd():
stdout, stderr, rv = system_call(cmd)
if rv != 0:
le = LogEntry.create(
'Fatal', "Command: %s\nError: %s\n" % (cmd, stderr),
info={'ebi_submission': preprocessed_data_id})
ebi_submission.study.ebi_submission_status = (
"failed: ASCP submission, log id: %d" % le.id)
raise ComputeError("EBI Submission failed! Log id: "
"%d" % le.id)
open(ebi_submission.ascp_reply, 'a').write(
'stdout:\n%s\n\nstderr: %s' % (stdout, stderr))
environ['ASPERA_SCP_PASS'] = old_ascp_pass
LogEntry.create('Runtime',
('Submission of sequences of pre_processed_id: '
'%d completed successfully' %
Expand All @@ -91,13 +84,11 @@ def submit_EBI(preprocessed_data_id, action, send):
LogEntry.create('Runtime',
("Submitting XMLs for pre_processed_id: "
"%d" % preprocessed_data_id))
try:
xml_content, stderr, _ = system_call(xmls_cmds)
except Exception as e:
xml_content, stderr, rv = system_call(xmls_cmds)
if rv != 0:
xml_content = ''
stderr = str(e)
le = LogEntry.create(
'Fatal', "Command: %s\nError: %s\n" % (cmd, str(e)),
'Fatal', "Command: %s\nError: %s\n" % (cmd, stderr),
info={'ebi_submission': preprocessed_data_id})
ebi_submission.study.ebi_submission_status = (
"failed: XML submission, log id: %d" % le.id)
Expand All @@ -107,9 +98,8 @@ def submit_EBI(preprocessed_data_id, action, send):
('Submission of sequences of pre_processed_id: '
'%d completed successfully' %
preprocessed_data_id))
finally:
open(ebi_submission.curl_reply, 'w').write(
'stdout:\n%s\n\nstderr: %s' % (xml_content, stderr))
open(ebi_submission.curl_reply, 'w').write(
'stdout:\n%s\n\nstderr: %s' % (xml_content, stderr))

try:
st_acc, sa_acc, bio_acc, ex_acc, run_acc = \
Expand Down Expand Up @@ -198,7 +188,9 @@ def submit_VAMPS(artifact_id):
qiita_config.vamps_pass,
targz_fp,
qiita_config.vamps_url))
obs, _, _ = system_call(cmd)
obs, stderr, rv = system_call(cmd)
if rv != 0:
raise ComputeError('Error: \nstderr: %s' % stderr)

exp = ("<html>\n<head>\n<title>Process Uploaded File</title>\n</head>\n"
"<body>\n</body>\n</html>")
Expand Down
2 changes: 1 addition & 1 deletion qiita_ware/private_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def submit_to_EBI(job):
param_vals = job.parameters.values
artifact_id = int(param_vals['artifact'])
submission_type = param_vals['submission_type']
submit_EBI(artifact_id, submission_type, False)
submit_EBI(artifact_id, submission_type, True)
job._set_status('success')


Expand Down
10 changes: 5 additions & 5 deletions scripts/qiita
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def webserver(build_docs):
sphinx_fp = join(base, 'support_files/doc/')
cmd = 'make -C %s html' % sphinx_fp
print('Building documentation ...')
try:
qdb.processing_job._system_call(cmd)
except Exception as e:
raise click.ClickException('Could not build documentation: %s' %
str(e))
stdout, stderr, rv = qdb.processing_job._system_call(cmd)
if rv != 0:
raise click.ClickException(
'Could not build documentation:\n'
'Std output:%s\nStd error:%s' % (stdout, stderr))
else:
print('Documentation successfully built')

Expand Down