projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
6260: Just use the token loaded by the SDK (ARVADOS_API_TOKEN),
[arvados.git]
/
doc
/
_includes
/
_run_md5sum_py.liquid
diff --git
a/doc/_includes/_run_md5sum_py.liquid
b/doc/_includes/_run_md5sum_py.liquid
index 16516a8852556fa374f8b7c05bc5b9cb6dff80c0..46152f17db17ac22dd12964bebcc63e035af19f9 100644
(file)
--- a/
doc/_includes/_run_md5sum_py.liquid
+++ b/
doc/_includes/_run_md5sum_py.liquid
@@
-3,7
+3,8
@@
import arvados
# Automatically parallelize this job by running one task per file.
import arvados
# Automatically parallelize this job by running one task per file.
-arvados.job_setup.one_task_per_input_file(if_sequence=0, and_end_task=True, input_as_path=True)
+arvados.job_setup.one_task_per_input_file(if_sequence=0, and_end_task=True,
+ input_as_path=True)
# Get the input file for the task
input_file = arvados.get_task_param_mount('input')
# Get the input file for the task
input_file = arvados.get_task_param_mount('input')
@@
-13,6
+14,6
@@
stdoutdata, stderrdata = arvados.util.run_command(['md5sum', input_file])
# Save the standard output (stdoutdata) to "md5sum.txt" in the output collection
out = arvados.CollectionWriter()
# Save the standard output (stdoutdata) to "md5sum.txt" in the output collection
out = arvados.CollectionWriter()
-out.set_current_file_name("md5sum.txt")
-
out
.write(stdoutdata)
+with out.open('md5sum.txt') as out_file:
+
out_file
.write(stdoutdata)
arvados.current_task().set_output(out.finish())
arvados.current_task().set_output(out.finish())