From: Martin Mares Date: Tue, 25 Feb 2014 09:45:30 +0000 (+0100) Subject: bex prun: Fix handling of failure states with no job attached X-Git-Tag: v3.3~6 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=7b62229dfff69e906e9d68f6809208335e135f36;p=bex.git bex prun: Fix handling of failure states with no job attached A perfect example is the LOCKED state. --- 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;