@@ -587,6 +587,18 @@ END
$constraintsq->fetchrow_array() or confess "$hostname ?";
};
+
+ if (!defined $flight) {
+ db_retry($dbh_tests,[], sub {
+ $insertq->execute($hostname, $ttaskid,
+ undef,undef,
+ undef,
+ undef,undef);
+ $checkconstraints->();
+ });
+ return;
+ }
+
my $ojvn = "$ho->{Ident}_lifecycle";
if (length $r{$ojvn}) {
@@ -660,26 +672,17 @@ END
}
}
- if (defined $flight) {
- $insertq->execute($hostname, $ttaskid,
- $flight, $job,
- ($mode eq 'selectprep')+0,
+ $insertq->execute($hostname, $ttaskid,
+ $flight, $job,
+ ($mode eq 'selectprep')+0,
# ^ DBD::Pg doesn't accept perl canonical false for bool!
# https://rt.cpan.org/Public/Bug/Display.html?id=133229
- $tident, $tstepno);
- } else {
- $insertq->execute($hostname, $ttaskid,
- undef,undef,
- undef,
- undef,undef);
- }
+ $tident, $tstepno);
$checkconstraints->();
});
- if (defined $flight) {
- push @lifecycle, $newsigil if length $newsigil;
- store_runvar($ojvn, "@lifecycle");
- }
+ push @lifecycle, $newsigil if length $newsigil;
+ store_runvar($ojvn, "@lifecycle");
}
sub current_stepno ($) { #method
This avoids running the runvar computation loop outside flights. This is good amongst other things because that loop prints warnings about undef $flight and $job. Signed-off-by: Ian Jackson <iwj@xenproject.org> --- Osstest/JobDB/Executive.pm | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-)