forked from lix-project/hydra
Disallow multiple jobs with the same name
This has been deprecated since a8db329839
.
Issue #60.
This commit is contained in:
parent
0d5a38a40b
commit
6284fd540d
|
@ -351,8 +351,19 @@ sub evalJobs {
|
||||||
SuppressEmpty => '')
|
SuppressEmpty => '')
|
||||||
or die "cannot parse XML output";
|
or die "cannot parse XML output";
|
||||||
|
|
||||||
|
my %jobNames;
|
||||||
|
my $errors;
|
||||||
my @filteredJobs = ();
|
my @filteredJobs = ();
|
||||||
foreach my $job (@{$jobs->{job}}) {
|
foreach my $job (@{$jobs->{job}}) {
|
||||||
|
# Ensure that there is only one job with the given
|
||||||
|
# name. FIXME: this check will become unnecessary after we
|
||||||
|
# remove support for multiple values per jobset input.
|
||||||
|
if (defined $jobNames{$job->{jobName}}) {
|
||||||
|
$errors .= "error: there are multiple jobs named ‘$job->{jobName}’\n\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
$jobNames{$job->{jobName}} = 1;
|
||||||
|
|
||||||
my $validJob = 1;
|
my $validJob = 1;
|
||||||
foreach my $arg (@{$job->{arg}}) {
|
foreach my $arg (@{$job->{arg}}) {
|
||||||
my $input = $inputInfo->{$arg->{name}}->[$arg->{altnr}];
|
my $input = $inputInfo->{$arg->{name}}->[$arg->{altnr}];
|
||||||
|
@ -362,15 +373,6 @@ sub evalJobs {
|
||||||
}
|
}
|
||||||
$jobs->{job} = \@filteredJobs;
|
$jobs->{job} = \@filteredJobs;
|
||||||
|
|
||||||
my %jobNames;
|
|
||||||
my $errors;
|
|
||||||
foreach my $job (@{$jobs->{job}}) {
|
|
||||||
$jobNames{$job->{jobName}}++;
|
|
||||||
if ($jobNames{$job->{jobName}} == 2) {
|
|
||||||
$errors .= "warning: there are multiple jobs named ‘$job->{jobName}’; support for this will go away soon!\n\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Handle utf-8 characters in error messages. No idea why this works.
|
# Handle utf-8 characters in error messages. No idea why this works.
|
||||||
utf8::decode($_->{msg}) foreach @{$jobs->{error}};
|
utf8::decode($_->{msg}) foreach @{$jobs->{error}};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue