8784: Fix test for latest firefox.
[arvados.git] / doc / _includes / _run_md5sum_py.liquid
1 #!/usr/bin/env python
2
3 import arvados
4
5 # Automatically parallelize this job by running one task per file.
6 arvados.job_setup.one_task_per_input_file(if_sequence=0, and_end_task=True,
7                                           input_as_path=True)
8
9 # Get the input file for the task
10 input_file = arvados.get_task_param_mount('input')
11
12 # Run the external 'md5sum' program on the input file
13 stdoutdata, stderrdata = arvados.util.run_command(['md5sum', input_file])
14
15 # Save the standard output (stdoutdata) to "md5sum.txt" in the output collection
16 out = arvados.CollectionWriter()
17 with out.open('md5sum.txt') as out_file:
18     out_file.write(stdoutdata)
19 arvados.current_task().set_output(out.finish())