hydra-evaluator: When evaluating a single jobset, exit with a failure code if evaluation fails

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-11-27 14:29:05 -05:00
parent dd4e57fb0c
commit a92a57f3b0

View file

@ -275,6 +275,7 @@ sub checkJobset {
checkJobsetWrapped($jobset); checkJobsetWrapped($jobset);
}; };
my $failed = 0;
if ($@) { if ($@) {
my $msg = $@; my $msg = $@;
print STDERR $msg; print STDERR $msg;
@ -282,6 +283,7 @@ sub checkJobset {
$jobset->update({lastcheckedtime => time}); $jobset->update({lastcheckedtime => time});
setJobsetError($jobset, $msg); setJobsetError($jobset, $msg);
}); });
$failed = 1;
} }
if (defined $triggerTime) { if (defined $triggerTime) {
@ -294,6 +296,7 @@ sub checkJobset {
if $new->triggertime == $triggerTime; if $new->triggertime == $triggerTime;
}); });
} }
return $failed;
} }
@ -324,8 +327,7 @@ if (scalar @ARGV == 2) {
my $projectName = $ARGV[0]; my $projectName = $ARGV[0];
my $jobsetName = $ARGV[1]; my $jobsetName = $ARGV[1];
my $jobset = $db->resultset('Jobsets')->find($projectName, $jobsetName) or die; my $jobset = $db->resultset('Jobsets')->find($projectName, $jobsetName) or die;
checkJobset($jobset); exit checkJobset($jobset);
exit 0;
} }