From 7b62229dfff69e906e9d68f6809208335e135f36 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 25 Feb 2014 10:45:30 +0100 Subject: [PATCH] bex prun: Fix handling of failure states with no job attached A perfect example is the LOCKED state. --- lib/bin/bex-prun | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/bin/bex-prun b/lib/bin/bex-prun index c20f6bc..e1ae42e 100755 --- a/lib/bin/bex-prun +++ b/lib/bin/bex-prun @@ -333,9 +333,11 @@ sub redraw_slot($) { $C->bkgdset(0); $C->addstr(sprintf("%3dD %3dW", $jcnt->{'done'}, $jcnt->{'ready'})); if ($stat eq 'DONE') { - if (defined $host_last_fail_stat{$mach}) { - $C->bkgdset(($host_last_fail_stat{$mach} eq 'NOPING') ? COLOR_PAIR(5) : COLOR_PAIR(4)); - $C->addstr(sprintf(" %-8s %s", $host_last_fail_stat{$mach}, $queue->job_name($host_last_fail_job{$mach}))); + my $lfs = $host_last_fail_stat{$mach}; + my $lfj = $host_last_fail_job{$mach}; + if (defined $lfs) { + $C->bkgdset(($lfs eq 'NOPING') ? COLOR_PAIR(5) : COLOR_PAIR(4)); + $C->addstr(sprintf(" %-8s %s", $lfs, $lfj ? $queue->job_name($lfj) : "")); } } else { my $text = sprintf(" %-8s %s", $stat, $jname); @@ -377,7 +379,7 @@ sub update($$$$) { $ui->set_job_status($mach, $jid, 'failed'); } else { for my $j (keys %{$job_state{$mach}}) { - $ui->set_job_status($mach, $jid, 'failed'); + $ui->set_job_status($mach, $j, 'failed'); } $ui->set_host_status($mach, 'failed'); $host_last_fail_job{$mach} = $jid; -- 2.39.2