From: Tom Clegg Date: Wed, 5 Jun 2013 20:46:52 +0000 (-0400) Subject: use IPC::System::Simple::capturex instead of system() X-Git-Tag: 1.1.0~3278 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/042ea6bfd5e476a7a30552a6ea57e3e2ad8017bf use IPC::System::Simple::capturex instead of system() --- diff --git a/services/crunch/crunch-job b/services/crunch/crunch-job index ed2c059a11..72563e68ad 100755 --- a/services/crunch/crunch-job +++ b/services/crunch/crunch-job @@ -55,6 +55,7 @@ use Arvados; use Getopt::Long; use Warehouse; use Warehouse::Stream; +use IPC::System::Simple qw(capturex); $ENV{"TMPDIR"} ||= "/tmp"; $ENV{"CRUNCH_TMP"} = $ENV{"TMPDIR"} . "/crunch-job"; @@ -686,10 +687,16 @@ $Job->save; if ($Job->{'output'}) { - $arv->{'collections'}->{'create'}->execute('collection' => { - 'uuid' => $Job->{'output'}, - 'manifest_text' => system("whget", $Job->{'output'}), - }); + eval { + my $manifest_text = capturex("whget", $Job->{'output'}); + $arv->{'collections'}->{'create'}->execute('collection' => { + 'uuid' => $Job->{'output'}, + 'manifest_text' => $manifest_text, + }); + }; + if ($@) { + Log (undef, "Failed to register output manifest: $@"); + } } Log (undef, "finish");