1import logging
2
3from autotest_lib.server import crashcollect
4
5
6def crashdumps(machine):
7    host = hosts.create_target_machine(machine)
8    try:
9        if has_failed_tests:
10            crashcollect.get_crashdumps(host, test_start_time)
11        else:
12            crashcollect.report_crashdumps(host)
13            crashcollect.fetch_orphaned_crashdumps(
14                    host, crashcollect.get_host_infodir(host))
15    except Exception as e:
16        logging.error('Crash collection failed with %s', e)
17
18job.parallel_simple(crashdumps, machines, log=False)
19